-
Notifications
You must be signed in to change notification settings - Fork 252
88 lines (74 loc) · 2.19 KB
/
build-fd-image.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
name: Building Fluentd image
on:
push:
branches:
- 'master'
tags:
- 'v*'
paths:
- ".github/workflows/build-fd-image.yaml"
- "cmd/fluent-watcher/fluentd/**"
- "cmd/fluent-watcher/hooks/**"
- "pkg/filenotify/**"
env:
FD_IMG: 'kubesphere/fluentd:v1.15.3'
ARCH: '-arm64'
FD_IMG_BASE: 'kubesphere/fluentd:v1.15.3-arm64-base'
jobs:
build-amd64:
runs-on: ubuntu-latest
timeout-minutes: 30
name: Build amd64 Image for Fluentd
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and Push amd64 Image for Fluentd
run: |
make build-fd-amd64 -e FD_IMG=${{ env.FD_IMG }}
docker push ${{ env.FD_IMG }}
build-arm64:
runs-on: ubuntu-latest
timeout-minutes: 90
name: Build arm64 Image for Fluentd
steps:
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: 1.19
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Build and Push arm64 base Image for Fluentd
run: |
make build-fd-arm64-base -e FD_IMG_BASE=${{ env.FD_IMG_BASE }}
- name: Build and Push arm64 Image for Fluentd
run: |
make build-fd-arm64 -e FD_IMG=${{ env.FD_IMG }} -e ARCH=${{ env.ARCH }}