From 63eda8aae489405396cb3049c0b20669889c156f Mon Sep 17 00:00:00 2001 From: Sean D Gillespie Date: Mon, 2 Dec 2024 15:05:41 -0500 Subject: [PATCH] CI: Only tag image latest on tag builds --- .github/workflows/release-ghcr.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-ghcr.yml b/.github/workflows/release-ghcr.yml index bfc20cd68..c078f96fa 100644 --- a/.github/workflows/release-ghcr.yml +++ b/.github/workflows/release-ghcr.yml @@ -61,10 +61,12 @@ jobs: docker-archive:./result \ docker://ghcr.io/${REPO_OWNER}/cardano-db-sync:$IMAGE_TAG - # Also tag it as latest - skopeo copy \ - docker-archive:./result \ - docker://ghcr.io/${REPO_OWNER}/cardano-db-sync:latest + # If it's a tag build, also tag it as latest + if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then + skopeo copy \ + docker-archive:./result \ + docker://ghcr.io/${REPO_OWNER}/cardano-db-sync:latest + fi - name: Upload ${{ github.actor }}/cardano-smash-server run: | @@ -76,7 +78,9 @@ jobs: docker-archive:./result \ docker://ghcr.io/${REPO_OWNER}/cardano-smash-server:$IMAGE_TAG - # Also tag it as latest - skopeo copy \ - docker-archive:./result \ - docker://ghcr.io/${REPO_OWNER}/cardano-smash-server:latest + # If it's a tag build, also tag it as latest + if [[ "$GITHUB_REF_TYPE" = "tag" ]]; then + skopeo copy \ + docker-archive:./result \ + docker://ghcr.io/${REPO_OWNER}/cardano-smash-server:latest + fi