1
+ # .github/workflows/release.yml
2
+ name : build
3
+
4
+ on :
5
+ pull_request :
6
+ push :
7
+ tags :
8
+ - v[0-9]+.*
9
+
10
+ permissions :
11
+ contents : write
12
+
13
+ jobs :
14
+ build :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Checkout
18
+ uses : actions/checkout@v4
19
+
20
+ - name : Set ENV
21
+ run : |
22
+ echo "KRB_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
23
+
24
+ - name : Login to Aliyun Container Registry
25
+ uses : docker/login-action@v3
26
+ with :
27
+ registry : ${{ vars.ALIYUNACR_REGISTRY }}
28
+ username : ${{ vars.ALIYUNACR_USERNAME }}
29
+ password : ${{ secrets.ALIYUNACR_TOKEN }}
30
+
31
+ - name : Login to Docker Hub
32
+ uses : docker/login-action@v3
33
+ with :
34
+ username : ${{ vars.DOCKERHUB_USERNAME }}
35
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
36
+
37
+ - name : Set up Docker Buildx
38
+ uses : docker/setup-buildx-action@v3
39
+
40
+ - name : Build and push krb-controller
41
+ uses : docker/build-push-action@v6
42
+ with :
43
+ platforms : |
44
+ linux/amd64
45
+ linux/arm64
46
+ push : true
47
+ build-args : |
48
+ KRB_APPNAME=krb-controller
49
+ tags :
50
+ registry.cn-hangzhou.aliyuncs.com/ketches/krb-controller:${{ env.KRB_VERSION }}
51
+ registry.cn-hangzhou.aliyuncs.com/ketches/krb-controller:latest
52
+ ketches/krb-controller:${{ env.KRB_VERSION }}
53
+ ketches/krb-controller:latest
54
+
55
+ - name : Build and push krb-webhook
56
+ uses : docker/build-push-action@v6
57
+ with :
58
+ platforms : |
59
+ linux/amd64
60
+ linux/arm64
61
+ push : true
62
+ build-args : |
63
+ KRB_APPNAME=krb-webhook
64
+ tags : |
65
+ registry.cn-hangzhou.aliyuncs.com/ketches/krb-webhook:${{ env.KRB_VERSION }}
66
+ registry.cn-hangzhou.aliyuncs.com/ketches/krb-webhook:latest
67
+ ketches/krb-webhook:${{ env.KRB_VERSION }}
68
+ ketches/krb-webhook:latest
0 commit comments