From 70db13b2e5d67ea68ac4b25c500d26b8b0598769 Mon Sep 17 00:00:00 2001 From: Zeno Ando <1124760+zenoando@users.noreply.github.com> Date: Tue, 12 Nov 2024 15:39:14 +1100 Subject: [PATCH] fixup: Control workflow runs --- .github/workflows/build.yaml | 2 ++ .github/workflows/pr-image.yaml | 1 + scripts/pr-image.sh | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 013413d..7ac663b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,6 +2,8 @@ name: Build and publish on: pull_request: + types: + - closed branches: - main release: diff --git a/.github/workflows/pr-image.yaml b/.github/workflows/pr-image.yaml index 409b196..1fec672 100644 --- a/.github/workflows/pr-image.yaml +++ b/.github/workflows/pr-image.yaml @@ -24,6 +24,7 @@ jobs: with: registry: ghcr.io username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build the image run: make build diff --git a/scripts/pr-image.sh b/scripts/pr-image.sh index b69c375..b12dc46 100755 --- a/scripts/pr-image.sh +++ b/scripts/pr-image.sh @@ -13,7 +13,10 @@ IMAGE_NAME="$1" BRANCH="$2" echo "🏷️ Setting tags for image '${IMAGE_NAME}:${BRANCH}-prbase" -docker tag "${IMAGE_NAME}:base" "${IMAGE_NAME}:${BRANCH}-prbase" +docker tag "${IMAGE_NAME}:prbase" "${IMAGE_NAME}:${BRANCH}-prbase" +docker tag "${IMAGE_NAME}:prbase" "${IMAGE_NAME}:latest" echo "📤 Pushing '${IMAGE_NAME}:${BRANCH}-prbase'" docker push "${IMAGE_NAME}:${BRANCH}-prbase" +docker push "${IMAGE_NAME}:prbase" +docker push "${IMAGE_NAME}:latest"