forked from python-discord/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 1015 Bytes
/
Copy pathdeploy.yml
File metadata and controls
42 lines (36 loc) · 1015 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Deploy
on:
workflow_run:
workflows: ["Build"]
branches:
- master
types:
- completed
jobs:
build:
if: github.event.workflow_run.conclusion == 'success'
name: Build & Push
runs-on: ubuntu-latest
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 code
uses: actions/checkout@v2
with:
repository: python-discord/kubernetes
token: ${{ secrets.REPO_TOKEN }}
- 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: |
bot/deployment.yaml
images: 'ghcr.io/python-discord/bot:${{ steps.sha_tag.outputs.tag }}'
kubectl-version: 'latest'