Skip to content

Commit

Permalink
🚧 Add image tag to step summary
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlin committed Mar 7, 2024
1 parent 648704b commit 811dc79
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci.release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Use the image built **for this branch** in Nextstrain CLI:

NEXTSTRAIN_DOCKER_IMAGE=docker.io/nextstrain/base:${TAG}

Note that this isn't always the image built for this CI run, as it will be
updated on new pushes to the branch.

<!---
TODO: Add instructions to use image built for this specific CI run. Not trivial
since it requires getting the SHA for each platform variant. Something like
this gets that info but is hacky:
image=nextstrain/base
tag=latest
token=$(curl --silent "https://auth.docker.io/token?scope=repository:$image:pull&service=registry.docker.io" | jq -r '.token')
curl -s --header "Accept: application/vnd.docker.distribution.manifest.list.v2+json" --header "Authorization: Bearer ${token}" "https://registry-1.docker.io/v2/$image/manifests/$tag" | jq -r '.manifests|.[]| "\(.digest) \(.platform.architecture) \(.platform.variant)"'
--->
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
outputs:
tag: ${{ env.TAG }}
digest:

# Run tests with the final image from GitHub Container Registry.
test:
Expand Down Expand Up @@ -198,6 +199,19 @@ jobs:
run: |
./devel/copy-images -i ghcr.io -o docker.io -t ${{ needs.build.outputs.tag }} -l
push-summary:
needs: [build, push-branch, push-build]
runs-on: ubuntu-latest
steps:
- name: Generate summary
run: |
# Replace ${x} in Markdown with value of environment variable "x".
perl -pe 's/\$\{(.+?)\}/$ENV{$1}/ge' \
< .github/workflows/ci.release.md \
> "$GITHUB_STEP_SUMMARY"
env:
TAG: ${{ needs.build.outputs.tag }}

# Run pathogen repo CI builds with the final image
test-pathogen-repo-ci:
# Only one of push-{branch,build} runs for any given workflow run, and
Expand Down

0 comments on commit 811dc79

Please sign in to comment.