chore(deps): update ksmanis/stage3 docker tag to v20241202 #1816
This file contains 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: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
DOCKERHUB_REPOSITORY: ksmanis/gentoo-distcc | |
DOCKERHUB_USERNAME: ksmanis | |
jobs: | |
images: | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: ["386", "amd64", "arm/v6", "arm/v7", "arm64", "ppc64le"] | |
manifest: ["tcp", "ssh", "tcp-ccache", "ssh-ccache"] | |
name: ${{ matrix.arch }}:${{ matrix.manifest }} image | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
outputs: | |
manifests: ${{ steps.output.outputs.manifests }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Prepare build variables | |
id: prep | |
run: | | |
{ | |
echo "base=$(echo "${{ matrix.manifest }}" | sed 's/^\(tcp\|ssh\)/distcc/')" | |
echo "qemu_platform=$(echo "${{ matrix.arch }}" | cut -d '/' -f 1)" | |
echo "stage3_version=$(sed -n 's#^FROM ksmanis/stage3:\(\S\+\).*#\1#p' Dockerfile)" | |
echo "tag=$(echo "${{ matrix.arch }}" | tr -d '/')-${{ matrix.manifest }}" | |
echo "target=distcc-$(echo "${{ matrix.manifest }}" | cut -d '-' -f 1)" | |
} >> "$GITHUB_OUTPUT" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3 | |
if: matrix.arch != 'amd64' | |
with: | |
platforms: ${{ steps.prep.outputs.qemu_platform }} | |
- name: Set up buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3 | |
- name: Define Docker metadata | |
id: docker-metadata | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5 | |
with: | |
images: | | |
docker.io/${{ env.DOCKERHUB_REPOSITORY }} | |
ghcr.io/${{ env.DOCKERHUB_REPOSITORY }} | |
flavor: | | |
latest=false | |
labels: | | |
org.opencontainers.image.title=gentoo-distcc | |
org.opencontainers.image.authors=Konstantinos Smanis <[email protected]> | |
tags: | | |
type=ref,event=branch,prefix=${{ steps.prep.outputs.tag }}-,suffix=-{{sha}} | |
type=ref,event=branch,prefix=${{ steps.prep.outputs.tag }}- | |
type=ref,event=pr,prefix=${{ steps.prep.outputs.tag }}-pr-,suffix=-{{sha}} | |
type=ref,event=pr,prefix=${{ steps.prep.outputs.tag }}-pr- | |
type=raw,value=${{ steps.prep.outputs.tag }}-${{ steps.prep.outputs.stage3_version }},enable={{is_default_branch}} | |
type=raw,value=${{ steps.prep.outputs.tag }},enable={{is_default_branch}} | |
- name: Build image | |
id: build | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6 | |
with: | |
build-args: | | |
BASE=${{ steps.prep.outputs.base }} | |
context: . | |
labels: ${{ steps.docker-metadata.outputs.labels }} | |
tags: ${{ steps.docker-metadata.outputs.tags }} | |
platforms: linux/${{ matrix.arch }} | |
target: ${{ steps.prep.outputs.target }} | |
load: true | |
- name: Inspect image | |
run: | | |
docker image inspect ${{ steps.build.outputs.imageid }} | |
- name: Test distcc | |
env: | |
DOCKER_DEFAULT_PLATFORM: linux/${{ matrix.arch }} | |
run: | | |
docker compose --ansi always -f docker-compose.test.yml -p test up \ | |
--exit-code-from distcc-${{ matrix.manifest }}-client \ | |
distcc-${{ matrix.manifest }}-client distcc-${{ matrix.manifest }}-server | |
- name: Log in to Docker Hub | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
username: ${{ env.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to GitHub Container registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push image | |
run: | | |
docker push --all-tags "docker.io/${DOCKERHUB_REPOSITORY}" | |
docker push --all-tags "ghcr.io/${DOCKERHUB_REPOSITORY}" | |
- name: Prepare outputs | |
id: output | |
run: | | |
echo "manifests=$(echo "${DOCKER_METADATA_OUTPUT_JSON}" | jq -cf --arg tag_prefix "${{ steps.prep.outputs.tag }}" manifests.jq)" >> "$GITHUB_OUTPUT" | |
manifests: | |
needs: images | |
strategy: | |
fail-fast: false | |
matrix: | |
manifest: ${{ fromJson(needs.images.outputs.manifests) }} | |
name: ${{ matrix.manifest.registry }}:${{ matrix.manifest.tag }} manifest | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Log in to Docker Hub | |
if: matrix.manifest.registry == 'docker.io' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
username: ${{ env.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to GitHub Container registry | |
if: matrix.manifest.registry == 'ghcr.io' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push manifest list | |
env: | |
REPO: ${{ matrix.manifest.repo }} | |
TAG: ${{ matrix.manifest.tag }} | |
run: | | |
./build-manifest.sh |