-
Notifications
You must be signed in to change notification settings - Fork 453
120 lines (109 loc) · 3.27 KB
/
build-kube-ovn-base.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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build Base
on:
workflow_dispatch:
schedule:
- cron: "20 19 * * *"
jobs:
build-amd64:
strategy:
fail-fast: false
matrix:
branch:
- master
- release-1.12
- release-1.11
- release-1.9
name: Build AMD64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v3
- name: Build
run: |
make base-amd64
make base-tar-amd64
- name: Upload image to artifact
uses: actions/upload-artifact@v3
with:
name: image-amd64-${{ matrix.branch }}
path: image-amd64.tar
build-arm64:
strategy:
fail-fast: false
matrix:
branch:
- master
- release-1.12
- release-1.11
- release-1.9
name: Build ARM64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Build
run: |
make base-arm64 || make base-arm64
make base-tar-arm64
- name: Upload image to artifact
uses: actions/upload-artifact@v3
with:
name: image-arm64-${{ matrix.branch }}
path: image-arm64.tar
push:
strategy:
fail-fast: false
matrix:
branch:
- master
- release-1.12
- release-1.11
- release-1.9
needs:
- build-arm64
- build-amd64
name: push
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v3
with:
name: image-amd64-${{ matrix.branch }}
- name: Download image
uses: actions/download-artifact@v3
with:
name: image-arm64-${{ matrix.branch }}
- name: Load Image
run: |
docker load --input image-amd64.tar
docker load --input image-arm64.tar
- name: Push
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
COMMIT: ${{ github.sha }}
run: |
cat VERSION
TAG=$(cat VERSION)
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker images
docker push kubeovn/kube-ovn-base:$TAG-amd64
docker push kubeovn/kube-ovn-base:$TAG-arm64
docker manifest create kubeovn/kube-ovn-base:$TAG kubeovn/kube-ovn-base:$TAG-amd64 kubeovn/kube-ovn-base:$TAG-arm64
docker manifest push kubeovn/kube-ovn-base:$TAG
if [ "${{ matrix.branch }}" = "master" -o "`printf '${{ matrix.branch }}\nrelease-1.11' | sort -Vr | head -n1`" = "${{ matrix.branch }}" ]; then
docker push kubeovn/kube-ovn-base:$TAG-debug-amd64
docker push kubeovn/kube-ovn-base:$TAG-debug-arm64
docker manifest create kubeovn/kube-ovn-base:$TAG-debug kubeovn/kube-ovn-base:$TAG-debug-amd64 kubeovn/kube-ovn-base:$TAG-debug-arm64
docker manifest push kubeovn/kube-ovn-base:$TAG-debug
fi