Implement docker arm build (necessary for Pull Request #34) (#37) #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 manylinux docker container | |
on: | |
push: | |
tags: | |
- '*' | |
branches: | |
- develop | |
- ci/* | |
paths: | |
- Dockerfile | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
branches: | |
- develop | |
paths: | |
- Dockerfile | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
steps: | |
- name: Prepare | |
run: | | |
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then | |
echo "TARGET_ARCH=x86_64" >> $GITHUB_ENV | |
elif [ "${{ matrix.platform }}" = "linux/arm64" ]; then | |
echo "TARGET_ARCH=aarch64" >> $GITHUB_ENV | |
fi | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./ | |
file: ./Dockerfile | |
push: ${{ github.ref == 'refs/heads/develop' }} | |
platforms: ${{ matrix.platform }} | |
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/resiliparse-manylinux_2_28_${{ env.TARGET_ARCH }}:latest | |
build-args: | | |
TARGET_ARCH=${{ env.TARGET_ARCH }} |