aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/lint-build-deploy.yaml (renamed from .github/workflows/lint-build.yaml)20
-rw-r--r--deployment.yaml21
2 files changed, 38 insertions, 3 deletions
diff --git a/.github/workflows/lint-build.yaml b/.github/workflows/lint-build-deploy.yaml
index 7001bc66..7ce5d9a3 100644
--- a/.github/workflows/lint-build.yaml
+++ b/.github/workflows/lint-build-deploy.yaml
@@ -1,4 +1,4 @@
-name: Linting & Building
+name: Lint, Build & Deploy
on:
push:
@@ -94,8 +94,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- build-and-push:
- name: Build and Push to Container Repositories
+ build-and-deploy:
+ name: Build and Deploy to Kubernetes
needs: lint
if: github.event_name != 'pull_request_target' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
@@ -142,3 +142,17 @@ jobs:
ghcr.io/python-discord/seasonalbot:${{ steps.sha_tag.outputs.tag }}
pythondiscord/seasonalbot:latest
pythondiscord/seasonalbot:${{ steps.sha_tag.outputs.tag }}
+
+ - 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:
+ manifests: |
+ deployment.yaml
+ images: 'ghcr.io/python-discord/seasonalbot:${{ steps.sha_tag.outputs.tag }}'
+ kubectl-version: 'latest'
diff --git a/deployment.yaml b/deployment.yaml
new file mode 100644
index 00000000..b04b528c
--- /dev/null
+++ b/deployment.yaml
@@ -0,0 +1,21 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: seasonalbot
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: seasonalbot
+ template:
+ metadata:
+ labels:
+ app: seasonalbot
+ spec:
+ containers:
+ - name: seasonalbot
+ image: ghcr.io/python-discord/seasonalbot:latest
+ imagePullPolicy: Always
+ envFrom:
+ - secretRef:
+ name: seasonalbot-env