Skip to content

[WIP] arm

[WIP] arm #46

Workflow file for this run

name: build
'on':
schedule:
-
cron: '0 0 * * 2'
push: null
pull_request:
branches:
- master
workflow_dispatch: null
jobs:
build_check_push_arch:
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: ubuntu-24.04
platform: linux/amd64
- arch: arm64
runner: ubuntu-24.04-arm
platform: linux/arm64
name: webdevops/toolbox:latest (${{ matrix.arch }})
runs-on: ${{ matrix.runner }}
container: webdevops/dockerfile-build-env
steps:
- uses: actions/checkout@v6
- uses: docker/setup-buildx-action@v3
- name: Build (load locally)
uses: docker/build-push-action@v6
with:
context: docker/toolbox/latest
platforms: ${{ matrix.platform }}
load: true
tags: ghcr.io/webdevops/toolbox:sha-${{ github.sha }}-${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Check
run: |
docker image inspect "ghcr.io/webdevops/toolbox:sha-${{ github.sha }}-${{ matrix.arch }}"
- name: 'Login to ghcr.io'
uses: docker/login-action@v3
if: "${{github.ref == 'refs/heads/arm'}}"
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push arch image
if: "${{github.ref == 'refs/heads/arm'}}"
run: |
docker push "ghcr.io/webdevops/toolbox:sha-${{ github.sha }}-${{ matrix.arch }}"
push_manifest:
runs-on: ubuntu-24.04
needs: build_check_push_arch
if: "${{github.ref == 'refs/heads/arm'}}"
steps:
- uses: docker/setup-buildx-action@v3
- name: 'Login to ghcr.io'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: 'Login to hub.docker.com'
uses: docker/login-action@v3
with:
username: '${{ secrets.DOCKERHUB_USERNAME }}'
password: '${{ secrets.DOCKERHUB_TOKEN }}'
- name: Create and push multi-arch manifest
run: |
docker buildx imagetools create \
-t "webdevops/toolbox:latest" \
-t "ghcr.io/webdevops/toolbox:latest" \
"ghcr.io/webdevops/toolbox:sha-${{ github.sha }}-amd64" \
"ghcr.io/webdevops/toolbox:sha-${{ github.sha }}-arm64"
# toolbox_latest:
# name: 'webdevops/toolbox:latest'
# runs-on: ubuntu-latest
# container: webdevops/dockerfile-build-env
# steps:
## -
## run: apt update && apt install sudo
# -
# uses: actions/checkout@v6
## -
## uses: docker/setup-docker-action@v4
## with:
## daemon-config: '{"features": {"containerd-snapshotter": true}}'
# -
# uses: docker/setup-buildx-action@v3
# -
# uses: docker/setup-qemu-action@v3
# -
# name: 'Build x64 & ARM'
# uses: docker/build-push-action@v6
# with:
# context: docker/toolbox/latest
# load: true
# tags: 'ghcr.io/webdevops/toolbox:latest,webdevops/toolbox:latest'
# platforms: linux/amd64,linux/arm64
# -
# run: |-
# docker image inspect --platform linux/amd64 webdevops/toolbox:latest
# docker image inspect --platform linux/arm64 webdevops/toolbox:latest
# -
## if: "${{github.ref == 'refs/heads/arm'}}"
# name: 'Login to ghcr.io'
# uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: '${{ github.actor }}'
# password: '${{ secrets.GITHUB_TOKEN }}'
# -
## if: "${{github.ref == 'refs/heads/arm'}}"
# name: 'Login to hub.docker.com'
# uses: docker/login-action@v3
# with:
# username: '${{ secrets.DOCKERHUB_USERNAME }}'
# password: '${{ secrets.DOCKERHUB_TOKEN }}'
# -
## if: "${{github.ref == 'refs/heads/arm'}}"
# name: Push
# uses: docker/build-push-action@v6
# with:
# context: docker/toolbox/latest
# push: true
# tags: 'ghcr.io/webdevops/toolbox:latest,webdevops/toolbox:latest'
# platforms: linux/amd64,linux/arm64