diff options
| -rw-r--r-- | .github/workflows/forms-backend.yml | 31 | 
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' | 
