Skip to content

Commit

Permalink
add job summary
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonStoldt committed Nov 17, 2023
1 parent 1356684 commit f2396c3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/actions/build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ inputs:
default: "alpine"
required: true

outputs:
digests:
description: "Image digests"
value: ${{ steps.build-and-push.outputs.digest }}
tags:
description: "Image tags"
value: ${{ steps.meta.outputs.tags }}

runs:
using: "composite"
steps:
Expand Down Expand Up @@ -76,3 +84,9 @@ runs:
# This step uses the identity token to provision an ephemeral certificate against the sigstore community Fulcio instance.
run: |
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
- name: Set output variables
shell: bash
run: |
echo "digests=${{ steps.build-and-push.outputs.digest }}" >> $GITHUB_OUTPUT
echo "tags=${{ steps.meta.outputs.tags }}" >> $GITHUB_OUTPUT
29 changes: 28 additions & 1 deletion .github/actions/post-run/action.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Post-run
description: "Tasks to run after pipeline is done"

inputs:
digests:
description: "Digests from previous build step"
required: false
tags:
description: "Tags from previous build step"
required: false

runs:
using: "composite"
Expand All @@ -9,4 +16,24 @@ runs:
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set job summary
shell: bash
run: |
cat >> $GITHUB_STEP_SUMMARY <<EOB
# Release Report
## Registries
- **Image Name:** ghostfolio-installer
- [![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?style=for-the-badge&logo=docker&logoColor=white)](docker_hub_url)
- ![GitHub](https://img.shields.io/badge/ghcr.io-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)(ghcr_io_url)
## Image Digests
> ${{ inputs.tags }}"
## Image Digests
> ${{ inputs.digests }}"
[docker_hub_url]: https://hub.docker.com/r/${{ github.repository_owner }}/${{ github.repository }}
[ghcr_io_url]: ${{ github.server_url}}/${{ github.repository_owner }}/${{ github.repository }}/pkgs/container/${{ github.repository }}
EOB
11 changes: 9 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: ./.github/actions/integration-test

build-and-push:
release:
needs: [integration-test]
name: Build and push image
runs-on: ubuntu-latest
Expand All @@ -36,21 +36,28 @@ jobs:
packages: write
# This is used to complete the identity challenge with sigstore/fulcio when running outside of PRs.
id-token: write
outputs:
digests: ${{ steps.build.outputs.digests }}
tags: ${{ steps.build.outputs.tags }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: ./.github/actions/build-and-push
id: build
with:
platform: ${{ matrix.platform }}
ansible_image_tag: ${{ matrix.ansible_image_tag }}

post-run:
needs: [ build-and-push ]
needs: [ release ]
name: Post-run
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: ./.github/actions/post-run
with:
digests: ${{ needs.release.outputs.digests }}
tags: ${{ needs.release.outputs.tags }}

0 comments on commit f2396c3

Please sign in to comment.