From a87c488d2f15bf2719f562fdbe50af629bae18ff Mon Sep 17 00:00:00 2001 From: Matthew Newton Date: Thu, 30 May 2024 15:59:20 +0100 Subject: [PATCH] CI: add workflow to build multi-arch images for dockerhub --- .github/workflows/dockerhub.yml | 68 +++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/dockerhub.yml diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml new file mode 100644 index 0000000000000..6aa067697f18d --- /dev/null +++ b/.github/workflows/dockerhub.yml @@ -0,0 +1,68 @@ +name: Dockerhub Dev + +on: + push: + branches-ignore: + - coverity_scan + workflow_dispatch: + +env: + CI: 1 + GH_ACTIONS: 1 + DEBIAN_FRONTEND: noninteractive + APT_OPTS: "-y --no-install-recommends" + +jobs: + # + # Run docker target for each given OS and ARCH. This will + # build the Docker images. + # + docker: + runs-on: ubuntu-22.04 + + strategy: + matrix: + os: + - ubuntu + - alpine + + arch: + - amd64 + - arm32v5 + - arm32v6 + - arm32v7 + - arm64v8 + + fail-fast: false + + name: "${{ matrix.os }}-${{ matrix.arch }}" + + steps: + + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Regenerate Dockerfiles + run: | + rm scripts/docker/dists/*/Dockerfile || true + make docker.regen + + - name: Install qemu + run: | + apt-get update + apt-get install ${APT_OPTS} qemu-user-static + + - name: Build docker image + run: | + make docker-${{ matrix.os }} DOCKER_TAG="freeradius-dev" DOCKER_BUILD_ARGS="--no-cache --platform linux/${{ matrix.arch }}" + + # + # If the CI has failed and the branch is ci-debug then start a tmate + # session. SSH rendezvous point is emited continuously in the job output. + # + - name: "Debug: Start tmate" + uses: mxschmitt/action-tmate@v3 + with: + limit-access-to-actor: true + if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }}