chore(deps): update docker.io/library/golang:1.23.4 docker digest to … #205
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: Image build | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- main | |
jobs: | |
generate-matrix: | |
name: Create build matrix | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.generate-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: Check code changes | |
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 | |
if: ${{ github.event_name == 'pull_request' }} | |
id: changes | |
with: | |
# These filter names must be synced with the `name` attribute for | |
# each entry in images.json. | |
filters: | | |
all: | |
- '.github/images.json' | |
- '.github/workflows/build.yaml' | |
cmapisrv-mock: | |
- 'cmapisrv-mock/**' | |
egw-scale-utils: | |
- 'egw-scale-utils/**' | |
- name: Generate matrix | |
id: generate-matrix | |
run: | | |
if [[ "${{ github.event_name }}" == "push" || "${{ steps.changes.outputs.all }}" == "true" ]]; then | |
echo "Using full matrix" | |
jq -c . ./.github/images.json > /tmp/matrix.json | |
else | |
echo "Building matrix from changes" | |
jq -c '{"include": [ .include[] | select(any(.name == ${{ steps.changes.outputs.changes }}[]; .)) ]}' ./.github/images.json > /tmp/matrix.json | |
fi | |
echo "Final matrix:" | |
jq . /tmp/matrix.json | |
echo "matrix=$(jq -c . /tmp/matrix.json)" >> $GITHUB_OUTPUT | |
build-and-push: | |
name: Build and Push | |
runs-on: ubuntu-latest | |
needs: generate-matrix | |
strategy: | |
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0 | |
- name: Login to quay.io | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_USERNAME_SCAFFOLDING }} | |
password: ${{ secrets.QUAY_PASSWORD_SCAFFOLDING }} | |
- name: Checkout Source Code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- name: Generate image tags | |
id: tags | |
run: | | |
base="quay.io/${{ github.repository_owner }}/${{ matrix.name }}" | |
if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "main" && "${{ github.repository }}" == "cilium/scaffolding" ]]; then | |
echo "tags=${base}:latest,${base}:${{ github.sha }}" >> $GITHUB_OUTPUT | |
else | |
echo "tags=${base}:${{ github.event.pull_request.head.sha || github.sha }}" >> $GITHUB_OUTPUT | |
fi | |
- name: Build and Push | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ matrix.dockerfile }} | |
push: ${{ github.event_name == 'push' }} | |
platforms: linux/amd64,linux/arm64 | |
tags: | | |
${{ steps.tags.outputs.tags }} |