diff options
-rw-r--r-- | .github/.github/FUNDING.yml | 2 | ||||
-rw-r--r-- | .github/workflows/lint-test-build-push.yaml | 17 | ||||
-rw-r--r-- | deployment.yaml | 20 |
3 files changed, 37 insertions, 2 deletions
diff --git a/.github/.github/FUNDING.yml b/.github/.github/FUNDING.yml deleted file mode 100644 index 6d9919e..0000000 --- a/.github/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -patreon: python_discord -custom: https://www.redbubble.com/people/pythondiscord diff --git a/.github/workflows/lint-test-build-push.yaml b/.github/workflows/lint-test-build-push.yaml index 62691ab..22f50d7 100644 --- a/.github/workflows/lint-test-build-push.yaml +++ b/.github/workflows/lint-test-build-push.yaml @@ -171,6 +171,23 @@ jobs: ghcr.io/python-discord/snekbox:latest ghcr.io/python-discord/snekbox:${{ steps.sha_tag.outputs.tag }} + # Deploy to Kubernetes + - name: Authenticate with Kubernetes + if: env.production_build == 'true' + uses: azure/k8s-set-context@v1 + with: + method: kubeconfig + kubeconfig: ${{ secrets.KUBECONFIG }} + + - name: Deploy to Kubernetes + if: env.production_build == 'true' + uses: Azure/k8s-deploy@v1 + with: + manifests: | + deployment.yaml + images: 'ghcr.io/python-discord/snekbox:${{ steps.sha_tag.outputs.tag }}' + kubectl-version: 'latest' + # Push the base image to GHCR, with an inline cache manifest - name: Push base image if: env.production_build == 'true' diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..a390a12 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: snekbox +spec: + replicas: 1 + selector: + matchLabels: + app: snekbox + template: + metadata: + labels: + app: snekbox + spec: + containers: + - name: snekbox + image: ghcr.io/python-discord/snekbox:latest + imagePullPolicy: Always + ports: + - containerPort: 8060 |