Build Base Image #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.18" >> $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 |