From 91e9adf6e0f4e354734fb2d86993fe202078ca3b Mon Sep 17 00:00:00 2001 From: Bryan Weber Date: Tue, 16 Jul 2024 10:33:33 -0400 Subject: [PATCH] Update the builder workflow --- .github/workflows/build-image.yml | 43 +++++++++++++++++++------------ 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml index 1040a84..96c29a0 100644 --- a/.github/workflows/build-image.yml +++ b/.github/workflows/build-image.yml @@ -1,55 +1,66 @@ -name: Build Image from Dockerfile +name: Build Image from Dockerfile on: push: - branches: [ master ] + branches: [ main ] + pull_request: + branches: [ main ] workflow_dispatch: jobs: - build_x86_64_wheels: + build_x86_64: name: Build image for x86_64 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: - file: ./Dockerfile_x86_64 platforms: linux/amd64 - push: true - tags: ghcr.io/${{ github.repository_owner }}/manylinux2014_x86_64-hdf5 + push: ${{ github.ref_name == 'main' }} + tags: ghcr.io/${{ github.repository_owner }}/manylinux2014_x86_64-hdf5-boost + build-args: | + TARGET_ARCH=x86_64 + cache-from: type=gha + cache-to: type=gha,mode=max - build_aarch64_wheels: + build_aarch64: name: Build image for aarch64 runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Setup up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: arm64 - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: - file: ./Dockerfile_aarch64 platforms: linux/arm64 - push: true - tags: ghcr.io/${{ github.repository_owner }}/manylinux2014_aarch64-hdf5 + push: ${{ github.ref_name == 'main' }} + tags: ghcr.io/${{ github.repository_owner }}/manylinux2014_aarch64-hdf5-boost + build-args: | + TARGET_ARCH=aarch64 + cache-from: type=gha + cache-to: type=gha,mode=max