-
Notifications
You must be signed in to change notification settings - Fork 2
36 lines (28 loc) · 1.13 KB
/
kubernetes.yml
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
name: deploy to kubernetes
on:
push:
branches:
- stable
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: login to docker
run: docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
- name: Build container image
run: |
docker build . --tag ghcr.io/callieve/okto/okto-bot:${{ github.sha }}
docker image tag ghcr.io/callieve/okto/okto-bot:${{ github.sha }} ghcr.io/callieve/okto/okto-bot:latest
- name: Push image to Docker Hub
run: |
docker push ghcr.io/callieve/okto/okto-bot:${{ github.sha }}
docker push ghcr.io/callieve/okto/okto-bot:latest
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Deploy to DigitalOcean Kubernetes
run: |
doctl kubernetes cluster kubeconfig save k8s-okto
kubectl -n discord-bots set image statefulset/stateful-okto okto-bot=ghcr.io/callieve/okto/okto-bot:${{ github.sha }}