diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml index 98a3099..0ed04e1 100644 --- a/.github/workflows/build_container.yml +++ b/.github/workflows/build_container.yml @@ -21,8 +21,39 @@ jobs: - id: set-matrix run: echo "matrix=$(jq -c . build_versions.json)" >> $GITHUB_OUTPUT - build-and-push-container: - runs-on: ubuntu-latest + build-X86-container: + runs-on: ubuntu-24.04 + permissions: + contents: read + packages: write + needs: setup-matrix + strategy: + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + steps: + - name: Build Vox Pupuli Test Box r${{ matrix.puppet_release }} + uses: voxpupuli/gha-build-and-publish-a-container@v2 + with: + registry_password: ${{ secrets.GITHUB_TOKEN }} + build_args: | + BASE_IMAGE=${{ matrix.base_image }} + RUBYGEM_PUPPET=${{ matrix.rubygem_puppet }} + RUBYGEM_FACTER=${{ matrix.rubygem_facter }} + RUBYGEM_VOXPUPULI_TEST=${{ matrix.rubygem_voxpupuli_test }} + RUBYGEM_VOXPUPULI_ACCEPTANCE=${{ matrix.rubygem_voxpupuli_acceptance }} + RUBYGEM_VOXPUPULI_RELEASE=${{ matrix.rubygem_voxpupuli_release }} + RUBYGEM_PUPPET_METADATA=${{ matrix.rubygem_puppet_metadata }} + RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }} + RUBYGEM_RUBOCOP_PERFORMANCE=${{ matrix.rubygem_rubocop_performance }} + RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }} + build_arch: linux/amd64 + docker_username: voxpupulibot + docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} + tags: | + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86_64 + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86_64 + + build-ARM-container: + runs-on: ubuntu-24.04-arm permissions: contents: read packages: write @@ -45,20 +76,88 @@ jobs: RUBYGEM_MODULESYNC=${{ matrix.rubygem_modulesync }} RUBYGEM_RUBOCOP_PERFORMANCE=${{ matrix.rubygem_rubocop_performance }} RUBYGEM_BUNDLER=${{ matrix.rubygem_bundler }} - build_arch: linux/amd64,linux/arm64 + build_arch: linux/arm64 docker_username: voxpupulibot docker_password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} tags: | - ghcr.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} - ghcr.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-latest - ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} - ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }} - ghcr.io/voxpupuli/voxbox:latest - docker.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} - docker.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-latest - docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} - docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }} - docker.io/voxpupuli/voxbox:latest + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 + + create-multiarch-manifests: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + needs: + - setup-matrix + - build-X86-container + - build-ARM-container + strategy: + matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} + steps: + - name: Log in to the ghcr.io registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Log in to the docker.io registry + uses: docker/login-action@v3 + with: + registry: docker.io + username: voxpupulibot + password: ${{ secrets.DOCKERHUB_BOT_PASSWORD }} + + - name: Create multiarch manifests + run: | + docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-latest \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }} \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t ghcr.io/voxpupuli/voxbox:latest \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + ghcr.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-${{ github.ref_name }} \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.rubygem_puppet }}-latest \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.ref_name }} \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }} \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + docker buildx imagetools create -t docker.io/voxpupuli/voxbox:latest \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-arm64 \ + docker.io/voxpupuli/voxbox:${{ matrix.puppet_release }}-${{ github.sha }}-x86 + + update-dockerhub-description: + runs-on: ubuntu-latest + needs: + - create-multiarch-manifests + steps: + - name: Source checkout + uses: actions/checkout@v4 - name: Update Docker Hub Description uses: peter-evans/dockerhub-description@v4 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 57f21ad..0d66ac0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,7 +21,7 @@ jobs: build-x86-container: name: 'Build x86 CI container' - runs-on: macarne + runs-on: ubuntu-24.04 permissions: actions: read contents: read @@ -72,7 +72,7 @@ jobs: build-ARM-container: name: 'Build ARM CI container' - runs-on: hetzner-arm + runs-on: ubuntu-24.04-arm permissions: actions: read contents: read