Skip to content

Commit 8928da2

Browse files
committed
workflow: refact with matrix; add arm64 EL7
1 parent fcc1051 commit 8928da2

2 files changed

Lines changed: 26 additions & 43 deletions

File tree

.github/workflows/build-images.yml

100644100755
Lines changed: 23 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -69,47 +69,29 @@ jobs:
6969
cache-from: type=gha
7070
cache-to: type=gha,mode=max
7171

72-
build-arm64-el8:
73-
runs-on: ubuntu-latest
74-
permissions:
75-
contents: read
76-
packages: write
77-
steps:
78-
- name: Checkout repository
79-
uses: actions/checkout@v4
80-
81-
- name: Set up QEMU
82-
uses: docker/setup-qemu-action@v3
83-
84-
- name: Set up Docker Buildx
85-
uses: docker/setup-buildx-action@v3
86-
87-
- name: Log in to Container Registry
88-
uses: docker/login-action@v3
89-
with:
90-
registry: ${{ env.REGISTRY }}
91-
username: ${{ github.actor }}
92-
password: ${{ secrets.GITHUB_TOKEN }}
93-
94-
- name: Build and push ARM64 EL8
95-
uses: docker/build-push-action@v5
96-
with:
97-
context: .
98-
platforms: linux/arm64
99-
file: ./docker/Dockerfile.centos-stream
100-
build-args: |
101-
VERSION_NUM=8
102-
CHINA_MIRROR=0
103-
push: true
104-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:aarch64_el8
105-
cache-from: type=gha
106-
cache-to: type=gha,mode=max
107-
108-
build-arm64-el9:
72+
build-arm64:
10973
runs-on: ubuntu-latest
11074
permissions:
11175
contents: read
11276
packages: write
77+
strategy:
78+
matrix:
79+
include:
80+
- tag_suffix: aarch64_el7
81+
dockerfile: ./docker/Dockerfile.centos
82+
build_args: |
83+
VERSION_NUM=7
84+
CHINA_MIRROR=0
85+
- tag_suffix: aarch64_el8
86+
dockerfile: ./docker/Dockerfile.centos-stream
87+
build_args: |
88+
VERSION_NUM=8
89+
CHINA_MIRROR=0
90+
- tag_suffix: aarch64_el9
91+
dockerfile: ./docker/Dockerfile.centos-stream
92+
build_args: |
93+
VERSION_NUM=9
94+
CHINA_MIRROR=0
11395
steps:
11496
- name: Checkout repository
11597
uses: actions/checkout@v4
@@ -127,16 +109,14 @@ jobs:
127109
username: ${{ github.actor }}
128110
password: ${{ secrets.GITHUB_TOKEN }}
129111

130-
- name: Build and push ARM64 EL9
112+
- name: Build and push ${{ matrix.tag_suffix }}
131113
uses: docker/build-push-action@v5
132114
with:
133115
context: .
134116
platforms: linux/arm64
135-
file: ./docker/Dockerfile.centos-stream
136-
build-args: |
137-
VERSION_NUM=9
138-
CHINA_MIRROR=0
117+
file: ${{ matrix.dockerfile }}
118+
build-args: ${{ matrix.build_args }}
139119
push: true
140-
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:aarch64_el9
120+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.tag_suffix }}
141121
cache-from: type=gha
142122
cache-to: type=gha,mode=max

.github/workflows/build-rpm.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
strategy:
1919
matrix:
2020
include:
21+
- tag: aarch64_el7
22+
el: "7"
23+
arch: aarch64
2124
- tag: aarch64_el8
2225
el: "8"
2326
arch: aarch64

0 commit comments

Comments
 (0)