aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-11-22 10:21:53 +0200
committerGravatar GitHub <[email protected]>2020-11-22 10:21:53 +0200
commit3b5af9736baff494743fc86e17d9ec3072610004 (patch)
tree720b1a8f088497c4b6d4ee0c687d5aa82028103e
parentCreate Kubernetes deployment manifest (diff)
Create job for deploying to Kubernetes
-rw-r--r--.github/workflows/forms-backend.yml31
1 files changed, 31 insertions, 0 deletions
diff --git a/.github/workflows/forms-backend.yml b/.github/workflows/forms-backend.yml
index 0d222b6..8da1e21 100644
--- a/.github/workflows/forms-backend.yml
+++ b/.github/workflows/forms-backend.yml
@@ -98,3 +98,34 @@ jobs:
tags: |
ghcr.io/python-discord/forms-backend:latest
ghcr.io/python-discord/forms-backend:${{ steps.sha_tag.outputs.tag }}
+
+ deploy:
+ name: Deployment
+ runs-on: ubuntu-latest
+
+ needs: [build]
+ if: github.ref == 'refs/heads/main'
+
+ steps:
+ - name: Create SHA Container Tag
+ id: sha_tag
+ run: |
+ tag=$(cut -c 1-7 <<< $GITHUB_SHA)
+ echo "::set-output name=tag::$tag"
+
+ - name: Checkout repository
+ uses: actions/checkout@v2
+
+ - name: Authenticate with Kubernetes
+ uses: azure/k8s-set-context@v1
+ with:
+ method: kubeconfig
+ kubeconfig: ${{ secrets.KUBECONFIG }}
+
+ - name: Deploy to Kubernetes
+ uses: Azure/k8s-deploy@v1
+ with:
+ manifest: |
+ deployment.yaml
+ images: 'ghcr.io/python-discord/forms-backend:${{ steps.sha_tag.outputs.tag }}'
+ kubectl-version: 'latest'