Skip to content

chore(deps): bump actions/add-to-project from 0.6.0 to 0.6.1 #371

chore(deps): bump actions/add-to-project from 0.6.0 to 0.6.1

chore(deps): bump actions/add-to-project from 0.6.0 to 0.6.1 #371

Workflow file for this run

name: Build
on:
pull_request:
branches: [main]
jobs:
prepare:
name: Create build matrix
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.matrix.outputs.config }}
any-changed: ${{ steps.changed-dockerfiles.outputs.any_changed }}
repository_owner: ${{ steps.environment.outputs.repository_owner }}
date_stamp: ${{ steps.environment.outputs.date_stamp }}
date: ${{ steps.environment.outputs.date }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Find changed dockerfiles
id: changed-dockerfiles
uses: tj-actions/[email protected]
with:
separator: ","
files: |
**/Dockerfile
**/.platforms
- name: Setup environment
id: environment
run: |
echo "repository_owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
echo "date_stamp=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT
- name: Setup matrix (for changed dockerfiles)
id: matrix
run: |
CONFIG=""
ALL_MODIFIED_FILES=${{ steps.changed-dockerfiles.outputs.all_modified_files }}
IFS=',' read -r -a DOCKERFILES <<< "$ALL_MODIFIED_FILES"
for DOCKERFILE in "${DOCKERFILES[@]}"; do
APATH=$(dirname ${DOCKERFILE})
VERSION=$(basename ${APATH})
NAME=$(basename $(dirname $APATH))
PLATFORMS=$(cat ${APATH}/.platforms || echo "linux/amd64")
CONFIG="${CONFIG:+${CONFIG}, }{\"path\": \"${APATH}\", \"version\": \"${VERSION}\", \"name\": \"${NAME}\", \"platforms\": \"${PLATFORMS}\"}"
done
echo "config=[${CONFIG}]" >> $GITHUB_OUTPUT
make-docker-images:
timeout-minutes: 10
runs-on: ubuntu-22.04
needs: prepare
strategy:
matrix:
context: ${{ fromJson(needs.prepare.outputs.matrix) }}
fail-fast: false
if: needs.prepare.outputs.any-changed == 'true'
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/[email protected]
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Make docker image
id: docker_build
uses: docker/build-push-action@v5
with:
context: ${{ matrix.context.path }}
platforms: ${{ matrix.context.platforms }}
push: false
tags: |
"ghcr.io/${{ needs.prepare.outputs.repository_owner }}/${{ matrix.context.name }}:${{ matrix.context.version }}-${{ needs.prepare.outputs.date_stamp }}"
labels: |
org.opencontainers.image.created=${{ needs.prepare.outputs.date_stamp }}
org.opencontainers.image.name=${{ matrix.context.name }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ matrix.context.version }}
org.opencontainers.image.vendor=${{ needs.prepare.outputs.repository_owner }}
org.opencontainers.image.url=https://github.com/${{ github.repository }}/tree/main/dockerfiles/${{ matrix.context.name }}/${{ matrix.context.version }}
org.opencontainers.image.source=https://github.com/${{ github.repository }}/tree/main/dockerfiles/${{ matrix.context.name }}/${{ matrix.context.version }}