aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yaml20
-rw-r--r--deployment.yaml21
2 files changed, 16 insertions, 25 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 20449741..b0c03139 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -10,7 +10,7 @@ on:
jobs:
build:
- if: github.event.workflow_run.conclusion == 'success'
+ if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push'
name: Build, Push, & Deploy Container
runs-on: ubuntu-latest
@@ -22,8 +22,20 @@ jobs:
tag=$(cut -c 1-7 <<< $GITHUB_SHA)
echo "::set-output name=tag::$tag"
+ # Check out the current repository in the `sir-lancebot` subdirectory
- name: Checkout code
uses: actions/checkout@v2
+ with:
+ path: sir-lancebot
+
+ # Check out the private "kubernetes" repository in the `kubernetes`
+ # subdirectory using a GitHub Personal Access Token
+ - name: Checkout code
+ uses: actions/checkout@v2
+ with:
+ repository: python-discord/kubernetes
+ token: ${{ secrets.REPO_TOKEN }}
+ path: kubernetes
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
@@ -41,8 +53,8 @@ jobs:
- name: Build and push
uses: docker/build-push-action@v2
with:
- context: .
- file: ./Dockerfile
+ context: sir-lancebot/
+ file: sir-lancebot/Dockerfile
push: true
cache-from: type=registry,ref=ghcr.io/python-discord/sir-lancebot:latest
cache-to: type=inline
@@ -60,6 +72,6 @@ jobs:
uses: Azure/k8s-deploy@v1
with:
manifests: |
- deployment.yaml
+ kubernetes/sir-lancebot/deployment.yaml
images: 'ghcr.io/python-discord/sir-lancebot:${{ steps.sha_tag.outputs.tag }}'
kubectl-version: 'latest'
diff --git a/deployment.yaml b/deployment.yaml
deleted file mode 100644
index cad97c18..00000000
--- a/deployment.yaml
+++ /dev/null
@@ -1,21 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-metadata:
- name: sir-lancebot
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: sir-lancebot
- template:
- metadata:
- labels:
- app: sir-lancebot
- spec:
- containers:
- - name: sir-lancebot
- image: ghcr.io/python-discord/sir-lancebot:latest
- imagePullPolicy: Always
- envFrom:
- - secretRef:
- name: sir-lancebot-env