Skip to content

Commit

Permalink
compute tag
Browse files Browse the repository at this point in the history
  • Loading branch information
haampie committed Oct 16, 2024
1 parent 01b830f commit 91b847e
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/multi-arch-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ name: Build
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v*
pull_request:
branches:
- main

permissions:
packages: write
Expand All @@ -23,9 +29,22 @@ jobs:
docker push ghcr.io/spack/manylinux2014:latest-$arch
done
docker manifest create ghcr.io/spack/manylinux2014:example \
# use tag pr-<number>, latest, or v* tag for multi-arch image tag.
if [ -n "$GITHUB_REF" ]; then
if [ "$GITHUB_REF" = "refs/pull/${{ github.event.pull_request.number }}/merge" ]; then
tag_name=pr-${{ github.event.pull_request.number }}
elif [ "$GITHUB_REF" = "refs/heads/main" ]; then
tag_name=latest
else
tag_name=${GITHUB_REF/refs\/tags\//}
fi
else
tag_name=latest
fi
docker manifest create ghcr.io/spack/manylinux2014:$tag_name \
ghcr.io/spack/manylinux2014:latest-x86_64 \
ghcr.io/spack/manylinux2014:latest-aarch64 \
ghcr.io/spack/manylinux2014:latest-ppc64le
docker manifest push ghcr.io/spack/manylinux2014:example
docker manifest push ghcr.io/spack/manylinux2014:$tag_name

0 comments on commit 91b847e

Please sign in to comment.