From 0e55ce417d0820d826e54de1c5e17e47798dd63a Mon Sep 17 00:00:00 2001 From: Florian Wilhelm <2292245+fwilhe@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:07:29 +0200 Subject: [PATCH] Don't try to deploy image from a PR (#11) --- .github/workflows/build-postgres-container.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-postgres-container.yml b/.github/workflows/build-postgres-container.yml index d5c72cb..bc8a0c9 100644 --- a/.github/workflows/build-postgres-container.yml +++ b/.github/workflows/build-postgres-container.yml @@ -72,15 +72,18 @@ jobs: run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}" - name: Get OIDC token + if: ${{ github.event_name != 'pull_request' }} id: get-token run: | IDTOKEN=$(curl -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=glvd" | jq -r '.value') echo "idToken=${IDTOKEN}" >> $GITHUB_OUTPUT - uses: azure/k8s-set-context@v4 + if: ${{ github.event_name != 'pull_request' }} with: method: kubeconfig kubeconfig: "${{ secrets.KUBECONFIG }}" - name: Deploy the image + if: ${{ github.event_name != 'pull_request' }} run: kubectl --namespace default --token "${{ steps.get-token.outputs.idToken }}" set image sts/glvd-database glvd-postgres=ghcr.io/gardenlinux/glvd-postgres@${{ steps.push-to-ghcr.outputs.digest }}