From 1fba89350461325211e6b7b20b2612282bec6fda Mon Sep 17 00:00:00 2001 From: Al Majumdar <88921269+restlessronin@users.noreply.github.com> Date: Sun, 3 Apr 2022 18:48:36 +0530 Subject: [PATCH] Add platforms to bake file to include m1 (arm64) (#733) * add platforms to bake file to include m1 (arm64) * add platforms to bake file to include m1 (arm64) * rebased to latest main * update docker/bake-action to latest version * test action fix * add qemu step * revert to older version of bake * remove arm64 from breaking build * test with vanilla buildx * cleanup * added platforms directive to default args * use build_push from current branch * explicit build_push dependency * use build push from current branch * specify branch name * experiment with syntax * use commit id for tag * experiment to extract branch from context * ditto * one more variation * revert * revert build push to version in current main * added comment to force build * force another build * comment out build on PR * test if event is pull request * first test, event is "none" * fix typo * correct syntax * set event name correctly * explicit variable for multi arch build * test multi arch build * test negated conditional * enable PR build * use env variable to control multi arch * test with env var * revert * revert * try syntax variation * check val * try variation * add platforms * re-enable PR builds * revert file * untested but should work * switch from env var to input for action * test against restlessronin branch * fix typo * cleanups * revert action link * refactor to explicit platform list * try variation * remove env toggle * retry * try multi build * ternary workaround * cleanup * revert action branch * fix typo * yat * revert to origin CI action * post review changes (untested) * no arm for v12 --- .github/workflows/build_bench.yml | 7 +++++++ .github/workflows/build_develop.yml | 1 + .github/workflows/build_stable.yml | 2 ++ .github/workflows/docker-build-push.yml | 5 +++++ 4 files changed, 15 insertions(+) diff --git a/.github/workflows/build_bench.yml b/.github/workflows/build_bench.yml index 1e0dc261..d7fdc3f4 100644 --- a/.github/workflows/build_bench.yml +++ b/.github/workflows/build_bench.yml @@ -22,6 +22,12 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + with: + image: tonistiigi/binfmt:latest + platforms: all + - name: Setup Buildx uses: docker/setup-buildx-action@v1 @@ -43,3 +49,4 @@ jobs: with: targets: bench push: true + set: "*.platform=linux/amd64,linux/arm64" diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml index a852c953..78a2c4cf 100644 --- a/.github/workflows/build_develop.yml +++ b/.github/workflows/build_develop.yml @@ -28,6 +28,7 @@ jobs: repo: erpnext version: develop push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/build_stable.yml b/.github/workflows/build_stable.yml index 62341c5b..6ddea4a7 100644 --- a/.github/workflows/build_stable.yml +++ b/.github/workflows/build_stable.yml @@ -40,6 +40,7 @@ jobs: repo: erpnext version: "12" push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} + platforms: linux/amd64 secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} @@ -50,6 +51,7 @@ jobs: repo: erpnext version: "13" push: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 secrets: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index aa3fa1c0..4479dbd2 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -14,6 +14,10 @@ on: push: required: true type: boolean + platforms: + required: true + type: string + description: "list of target platforms" secrets: DOCKERHUB_USERNAME: required: true @@ -83,3 +87,4 @@ jobs: uses: docker/bake-action@v1.7.0 with: push: true + set: "*.platform=${{ inputs.platforms }}"