Skip to content

Commit

Permalink
Deploy Image to Cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilhe authored Sep 23, 2024
1 parent fcbcece commit b2c13c2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build-postgres-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
contents: read
# Push container images
packages: write
# This is required for requesting the JWT
id-token: write

jobs:
build:
Expand Down Expand Up @@ -68,3 +70,17 @@ jobs:
- name: Print image url
if: ${{ github.event_name != 'pull_request' }}
run: echo "Image pushed to ${{ steps.push-to-ghcr.outputs.registry-paths }}"

- name: Get OIDC token
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
with:
method: kubeconfig
kubeconfig: "${{ secrets.KUBECONFIG }}"

- name: Deploy the image
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 }}

0 comments on commit b2c13c2

Please sign in to comment.