-
Notifications
You must be signed in to change notification settings - Fork 57
57 lines (55 loc) · 1.39 KB
/
kubeadm.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
name: Sync Kubeadm
on:
push:
branches: [ disabled ]
pull_request:
branches: [ disabled ]
jobs:
build:
name: Build imgsync
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v2
with:
go-version: 1.14
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Cache go mod
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build binary file
run: make bin
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: imgsync
path: imgsync
sync_k8s:
name: Sync k8s.gcr.io
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: imgsync
path: ./imgsync
- name: Cache manifests
uses: actions/cache@v1
with:
path: manifests
key: kubeadm
- name: Sync k8s.gcr.io images
env:
TZ: Asia/Shanghai
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
chmod +x ./imgsync/imgsync
./imgsync/imgsync gcr --kubeadm --user ${DOCKER_USER} --password ${DOCKER_PASSWORD}