-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (39 loc) · 1.34 KB
/
build-rolebot.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
37
38
39
40
41
42
name: Build and Deploy
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build-docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v2
- name: Log in to container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push image
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/vzma/discord-role-bot:${{ github.sha }}
ghcr.io/vzma/discord-role-bot:master
ghcr.io/vzma/discord-role-bot:latest
deploy-docker-image:
needs: build-docker-image
runs-on: ubuntu-latest
steps:
- name: Initialize doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log into K8s cluster
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 k8s-zma-website
- name: Deploy image to cluster
run: kubectl set image deployment/discord-role-bot discord-role-bot=ghcr.io/vzma/discord-role-bot:${{ github.sha }} --record -n zma-web-stack
- name: Verify deployment
run: kubectl rollout status deployment/discord-role-bot -n zma-web-stack