[WIP] arm #41
Workflow file for this run
This file contains hidden or 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 | |
| '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 | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build (load locally) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: ${{ matrix.platform }} | |
| load: true | |
| tags: ghcr.io/webdevops/toolbox:latest: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:latest:sha-${{ github.sha }}-${{ matrix.arch }}" | |
| - name: Push arch image | |
| run: | | |
| docker push "ghcr.io/webdevops/toolbox:latest:sha-${{ github.sha }}-${{ matrix.arch }}" | |
| push_manifest: | |
| runs-on: ubuntu-24.04 | |
| needs: build_check_push_arch | |
| steps: | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| IMAGE="ghcr.io/webdevops/toolbox:latest" | |
| docker buildx imagetools create \ | |
| -t "${IMAGE}:sha-${{ github.sha }}" \ | |
| "${IMAGE}:sha-${{ github.sha }}-amd64" \ | |
| "${IMAGE}: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@v4 | |
| ## - | |
| ## 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/master'}}" | |
| # 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/master'}}" | |
| # 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/master'}}" | |
| # 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 |