Skip to content

Commit

Permalink
Add ability to tag latest images during publishing (#427)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Oct 15, 2024
1 parent 6a2ce25 commit 108d802
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'
run: |
docker tag "ghcr.io/ansible/ansible-devspaces:${GITHUB_SHA}" "ghcr.io/ansible/ansible-devspaces:${{ github.event.release.tag_name }}"
docker tag "ghcr.io/ansible/ansible-devspaces:${GITHUB_SHA}" "ghcr.io/ansible/ansible-devspaces:latest"
docker push "ghcr.io/ansible/ansible-devspaces:${{ github.event.release.tag_name }}"
docker push "ghcr.io/ansible/ansible-devspaces:latest"
publish-wheel:
needs:
Expand Down
15 changes: 8 additions & 7 deletions tools/ee.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ if [ "--publish" == "${1:-}" ]; then
${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} pull -q "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64"

TAG=ghcr.io/ansible/community-ansible-dev-tools:${2:-}
${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
for TAG in ghcr.io/ansible/community-ansible-dev-tools:${2:-} ghcr.io/ansible/community-ansible-dev-tools:latest; do
${ADT_CONTAINER_ENGINE} manifest create "$TAG" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-amd64" --amend "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"
${ADT_CONTAINER_ENGINE} manifest annotate --arch arm64 "$TAG" "ghcr.io/ansible/community-ansible-dev-tools-tmp:${GITHUB_SHA:-}-arm64"

# We push only when there is a release, and that is when $2 is not the same as GITHUB_SHA
if [ "--dry" != "${3:-}" ]; then
${ADT_CONTAINER_ENGINE} manifest push "$TAG"
fi
# We push only when there is a release, and that is when $2 is not the same as GITHUB_SHA
if [ "--dry" != "${3:-}" ]; then
${ADT_CONTAINER_ENGINE} manifest push "$TAG"
fi
done
exit 0
fi

Expand Down

0 comments on commit 108d802

Please sign in to comment.