Split arches into separate builds

This commit is contained in:
tobbenb 2020-10-05 22:49:52 +02:00
parent c34e3ac4ad
commit 3cee147314
3 changed files with 90 additions and 28 deletions

View File

@ -1,4 +1,4 @@
name: Build Image
name: Build aarch64
on:
push:
@ -7,8 +7,6 @@ on:
pull_request:
paths-ignore:
- 'README.md'
schedule:
- cron: '0 20 * * 5'
jobs:
build:
@ -31,34 +29,10 @@ jobs:
run: |
sudo docker run --privileged linuxkit/binfmt:v0.7
sudo docker run -d --privileged -p 1234:1234 --name buildkit moby/buildkit:latest --addr tcp://0.0.0.0:1234 \
--oci-worker-platform linux/${PLATFORM_1} \
--oci-worker-platform linux/${PLATFORM_2} \
--oci-worker-platform linux/${PLATFORM_3}
sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- name: Build amd64
env:
DOCKERFILE_LOCATION: ./Dockerfile
run: |
buildctl build --frontend dockerfile.v0 \
--opt platform=linux/${PLATFORM_1} \
--opt filename=./${DOCKERFILE_LOCATION} \
--output type=docker,name=${REPO}:${DOCKER_TAG}-${PLATFORM_1} \
--local dockerfile=. \
--local context=. | docker load
- name: Build armhf
env:
DOCKERFILE_LOCATION: ./Dockerfile.armhf
run: |
buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/${PLATFORM_2} \
--frontend-opt filename=./${DOCKERFILE_LOCATION} \
--output type=docker,name=${REPO}:${DOCKER_TAG}-${PLATFORM_2} \
--local dockerfile=. \
--local context=. | docker load
- name: Build arm64
env:
DOCKERFILE_LOCATION: ./Dockerfile.aarch64
run: |

44
.github/workflows/build-amd64.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Build Image
on:
push:
paths-ignore:
- 'README.md'
pull_request:
paths-ignore:
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
env:
BUILDKIT_HOST: tcp://0.0.0.0:1234
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_IMAGE: hass-wheel-builder
DOCKER_TAG: latest
PLATFORM_1: amd64
PLATFORM_2: arm
PLATFORM_3: arm64
REPO: tobbenb/hass-wheel-builder-test
steps:
- uses: actions/checkout@v1
- name: Getting buildkit
run: |
sudo docker run --privileged linuxkit/binfmt:v0.7
sudo docker run -d --privileged -p 1234:1234 --name buildkit moby/buildkit:latest --addr tcp://0.0.0.0:1234 \
--oci-worker-platform linux/${PLATFORM_1}
sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- name: Build amd64
env:
DOCKERFILE_LOCATION: ./Dockerfile
run: |
buildctl build --frontend dockerfile.v0 \
--opt platform=linux/${PLATFORM_1} \
--opt filename=./${DOCKERFILE_LOCATION} \
--output type=docker,name=${REPO}:${DOCKER_TAG}-${PLATFORM_1} \
--local dockerfile=. \
--local context=. | docker load

44
.github/workflows/build-armhf.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Build armhf
on:
push:
paths-ignore:
- 'README.md'
pull_request:
paths-ignore:
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
env:
BUILDKIT_HOST: tcp://0.0.0.0:1234
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_IMAGE: hass-wheel-builder
DOCKER_TAG: latest
PLATFORM_1: amd64
PLATFORM_2: arm
PLATFORM_3: arm64
REPO: tobbenb/hass-wheel-builder-test
steps:
- uses: actions/checkout@v1
- name: Getting buildkit
run: |
sudo docker run --privileged linuxkit/binfmt:v0.7
sudo docker run -d --privileged -p 1234:1234 --name buildkit moby/buildkit:latest --addr tcp://0.0.0.0:1234 \
--oci-worker-platform linux/${PLATFORM_2}
sudo docker cp buildkit:/usr/bin/buildctl /usr/bin/
- name: Build armhf
env:
DOCKERFILE_LOCATION: ./Dockerfile.armhf
run: |
buildctl build --frontend dockerfile.v0 \
--frontend-opt platform=linux/${PLATFORM_2} \
--frontend-opt filename=./${DOCKERFILE_LOCATION} \
--output type=docker,name=${REPO}:${DOCKER_TAG}-${PLATFORM_2} \
--local dockerfile=. \
--local context=. | docker load