-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.33 KB
/
release.yaml
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
43
44
45
46
47
48
name: Release
on:
release:
types:
- published
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: vahter-robot
password: ${{ secrets.GH_CI_TOKEN }}
registry: ghcr.io
repository: ${{ github.repository }}
tag_with_ref: true
- name: Extract service name
uses: bluwy/substitute-string-action@v1
id: substr
with:
_input-text: ${{ github.repository }}
vahter-robot/: ''
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_CI_TOKEN }}
- name: Save DigitalOcean kubeconfig
run: doctl kubernetes cluster kubeconfig save k8s
- name: Update deployment file
run: sed -i 's|busybox|ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }}|' $GITHUB_WORKSPACE/deploy/deployment.yaml
- name: Apply deployment
run: kubectl -n vahter-robot apply -f ${{ github.workspace }}/deploy
- name: Verify deployment
run: kubectl -n vahter-robot rollout status deployment/${{ steps.substr.outputs.result }}