Skip to content

chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to… #1352

chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to…

chore(deps): update pre-commit hook igorshubovych/markdownlint-cli to… #1352

Workflow file for this run

---
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"]
target: ["tcp", "ssh"]
name: ${{ matrix.arch }}:${{ matrix.target }} image
runs-on: ubuntu-latest
continue-on-error: true
outputs:
manifests: ${{ steps.output.outputs.manifests }}
steps:
- name: Check out code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Prepare build variables
id: prep
run: |
{
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.target }}"
} >> "$GITHUB_OUTPUT"
- name: Set up QEMU
uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
if: matrix.arch != '386' && matrix.arch != 'amd64'
with:
platforms: ${{ steps.prep.outputs.qemu_platform }}
- name: Set up buildx
uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
- name: Define Docker metadata
id: docker-metadata
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4
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@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
with:
context: .
labels: ${{ steps.docker-metadata.outputs.labels }}
tags: ${{ steps.docker-metadata.outputs.tags }}
platforms: linux/${{ matrix.arch }}
target: distcc-${{ matrix.target }}
load: true
- name: Inspect image
run: |
docker image inspect ${{ steps.build.outputs.imageid }}
- name: Build test image
id: build-test
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825 # v4
with:
context: .
platforms: linux/${{ matrix.arch }}
target: distcc-${{ matrix.target }}-test
load: true
- name: Test distcc
env:
DOCKER_DEFAULT_PLATFORM: linux/${{ matrix.arch }}
IMAGE: ${{ steps.build.outputs.imageid }}
TEST_IMAGE: ${{ steps.build-test.outputs.imageid }}
run: |
docker compose -f docker-compose.test.yml -p test up \
--exit-code-from distcc-${{ matrix.target }}-client \
distcc-${{ matrix.target }}-client distcc-${{ matrix.target }}-server
- name: Log in to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to GitHub Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
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 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@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Log in to Docker Hub
if: matrix.manifest.registry == 'docker.io'
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
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@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
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