Fix image tags in release workflow (#1977)

Two bugs:
- fix typo in debug release_tag (should be release-tag)
- only tag :latest images as :v1.X.Y; tag non-:latest images as
  :v1.X.Y-debug etc.
This commit is contained in:
Jason Hall
2022-03-10 15:30:18 -05:00
committed by GitHub
parent fce9b7daa4
commit f38043ff59
+14 -3
View File
@@ -43,7 +43,7 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/s390x
image-name: gcr.io/kaniko-project/executor
tag: ${{ github.sha }}-debug
release_tag: debug
release-tag: debug
- image: executor-slim
dockerfile: ./deploy/Dockerfile_slim
@@ -109,7 +109,18 @@ jobs:
- if: startsWith(github.ref, 'refs/tags/v')
name: Apply release tags
run: |
crane cp ${{ matrix.image-name }}@${{ steps.build-and-push.outputs.digest }} \
${{ matrix.image-name }}:${GITHUB_REF/refs\/tags\//}
tag=${GITHUB_REF/refs\/tags\//}
# Tag :latest, :debug, :slim
crane cp ${{ matrix.image-name }}@${{ steps.build-and-push.outputs.digest }} \
${{ matrix.image-name }}:${{ matrix.release-tag }}
if [[ ${{ matrix.release-tag }} -eq "latest" ]]; then
# Tag :latest images as :v1.X.Y
crane cp ${{ matrix.image-name }}@${{ steps.build-and-push.outputs.digest }} \
${{ matrix.image-name }}:${tag}
else
# Or tag :v1.X.Y-debug and :v1.X.Y-slim
crane cp ${{ matrix.image-name }}@${{ steps.build-and-push.outputs.digest }} \
${{ matrix.image-name }}:${tag}-${{ matrix.release-tag }}
fi