-
Notifications
You must be signed in to change notification settings - Fork 17
103 lines (95 loc) · 2.99 KB
/
build.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: build
on:
push:
branches:
- master
pull_request:
jobs:
build-github-bot-image:
name: Build github-bot image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# longhornio/github-bot image
- name: docker-dry-run
uses: docker/build-push-action@v5
with:
context: github-bot
push: false
platforms: linux/amd64
tags: longhornio/github-bot:master
file: github-bot/Dockerfile
build-args: |
ARCH=amd64
- name: Login to Docker Hub
if: ${{ startsWith(github.ref, 'refs/heads/') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker-publish
if: ${{ startsWith(github.ref, 'refs/heads/') }}
uses: docker/build-push-action@v5
with:
context: github-bot
push: true
platforms: linux/amd64
tags: longhornio/github-bot:master
file: github-bot/Dockerfile
build-args: |
ARCH=amd64
build-github-runner-authorizer-image:
name: Build github-runner-authorizer image
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# longhornio/github-runner-authorizer image
- name: docker-dry-run
uses: docker/build-push-action@v5
with:
context: github-runner-authorizer
push: false
platforms: linux/amd64
tags: longhornio/github-runner-authorizer:master
file: github-runner-authorizer/Dockerfile
build-args: |
ARCH=amd64
- name: Login to Docker Hub
if: ${{ startsWith(github.ref, 'refs/heads/') }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: docker-publish
if: ${{ startsWith(github.ref, 'refs/heads/') }}
uses: docker/build-push-action@v5
with:
context: github-runner-authorizer
push: true
platforms: linux/amd64
tags: longhornio/github-runner-authorizer:master
file: github-runner-authorizer/Dockerfile
build-args: |
ARCH=amd64
deploy-longhorn-bot-images:
name: Deploy Longhorn bot images
if: ${{ startsWith(github.ref, 'refs/heads/') }}
runs-on: ubuntu-latest
needs:
- build-github-bot-image
- build-github-runner-authorizer-image
steps:
- name: Rollout restart github-bot
uses: actions-hub/[email protected]
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment -n github-bot github-bot
- name: Rollout restart github-runner github-runner-authorizer
uses: actions-hub/[email protected]
env:
KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }}
with:
args: rollout restart deployment -n github-runner github-runner-authorizer --token=$TOKEN --server=$API_SERVER_ARRD --insecure-skip-tls-verify