From 380488d20b509e0ca8178d68539394cb4f521612 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sun, 18 Aug 2024 21:56:06 +0100 Subject: [PATCH] Add deployment on commits to main --- .github/workflows/build-deploy.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build-deploy.yaml b/.github/workflows/build-deploy.yaml index 7a845f1..fe0fc04 100644 --- a/.github/workflows/build-deploy.yaml +++ b/.github/workflows/build-deploy.yaml @@ -50,3 +50,31 @@ jobs: ghcr.io/owl-corp/thallium-${{ inputs.project }}:${{ inputs.sha-tag }} build-args: | git_sha=${{ github.sha }} + + deploy: + name: Deploy + needs: build + runs-on: ubunut-latest + if: ${{ github.ref == 'refs/heads/main' }} + steps: + - name: Checkout Kubernetes repository + uses: actions/checkout@v4 + with: + repository: python-discord/infra + path: infra + + - uses: azure/setup-kubectl@v4 + + - name: Authenticate with Kubernetes + uses: azure/k8s-set-context@v4 + with: + method: kubeconfig + kubeconfig: ${{ secrets.KUBECONFIG }} + + - name: Deploy to Kubernetes + uses: azure/k8s-deploy@v5 + with: + namespace: merch + manifests: | + infra/kubernetes/namespaces/merch/deployment.yaml + images: 'ghcr.io/owl-corp/thallium:${{ inputs.sha-tag }}'