-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 2.19 KB
/
build-base.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
58
59
60
61
62
63
64
65
66
name: Build Base Image
on:
push:
paths:
- 'docker/build_framework.Dockerfile'
- 'scripts/*.*'
workflow_dispatch:
concurrency:
group: build-base-framework
cancel-in-progress: true
jobs:
build_base:
name: ${{ matrix.build_linux }} • ${{ matrix.build_arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_arch: [ "arm64", "amd64" ]
build_linux: [ manylinux, musllinux ]
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: ManyLinux Amd64 prepare
if: matrix.build_linux == 'manylinux' && matrix.build_arch == 'amd64'
run: |
echo BUILD_IMG="quay.io/pypa/manylinux2014_x86_64" >> $GITHUB_ENV
echo BASE_INIT_1="install_basic_centos.sh" >> $GITHUB_ENV
echo BASE_INIT_2="install_other_centos.sh" >> $GITHUB_ENV
- name: ManyLinux Arm64 prepare
if: matrix.build_linux == 'manylinux' && matrix.build_arch == 'arm64'
run: |
echo BUILD_IMG="quay.io/pypa/manylinux2014_aarch64" >> $GITHUB_ENV
echo BASE_INIT_1="install_basic_centos.sh" >> $GITHUB_ENV
echo BASE_INIT_2="install_other_centos.sh" >> $GITHUB_ENV
- name: MuslLinux prepare
if: matrix.build_linux == 'musllinux'
run: |
echo BUILD_IMG="alpine:3.17" >> $GITHUB_ENV
echo BASE_INIT_1="install_basic_alpine.sh" >> $GITHUB_ENV
echo BASE_INIT_2="install_other_alpine.sh" >> $GITHUB_ENV
- name: Build Base Image
uses: docker/build-push-action@v4
with:
context: ./scripts
file: docker/build_framework.Dockerfile
build-args: |
BUILD_IMG=${{ env.BUILD_IMG }}
BASE_INIT_1=${{ env.BASE_INIT_1 }}
BASE_INIT_2=${{ env.BASE_INIT_2 }}
platforms: linux/${{ matrix.build_arch }}
push: false
cache-from: type=gha,scope=build-${{ matrix.build_linux }}-${{ matrix.build_arch }}
cache-to: type=gha,mode=max,scope=build-${{ matrix.build_linux }}-${{ matrix.build_arch }}
target: base