aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2020-11-19 00:41:54 +0000
committerGravatar GitHub <[email protected]>2020-11-19 00:41:54 +0000
commit39e9ce404e0336fb44ffda9207c47b7af5417227 (patch)
tree0f02537c4d6dd5fce86a8940b2c59d4d7e300e99
parentMerge pull request #79 from python-discord/sebastiaan/backend/migrate-ci-to-g... (diff)
parentAdd production_build == 'true' condition on deploy. (diff)
Merge pull request #80 from python-discord/lemon/kubernetes_manifest
-rw-r--r--.github/.github/FUNDING.yml2
-rw-r--r--.github/workflows/lint-test-build-push.yaml17
-rw-r--r--deployment.yaml20
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