Skip to content

Build Framework

Build Framework #15

name: Build Framework
on:
workflow_dispatch:
workflow_run:
workflows: [ Build Base Image ]
types:
- completed
concurrency:
group: build-base-framework
cancel-in-progress: true
jobs:
build_framework:
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
name: ${{ matrix.build_linux }} • ${{ matrix.build_arch }}
runs-on: ubuntu-latest
strategy:
fail-fast: true
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: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Production 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: true
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 }}
tags: ghcr.io/${{ github.repository }}/${{ matrix.build_linux }}_${{ matrix.build_arch }}:latest
target: framework