Update minimal #37
Workflow file for this run
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: Containers | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'dockerfiles/**' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'dockerfiles/**' | |
jobs: | |
detect-changes: | |
runs-on: ubuntu-latest | |
name: Detect changes to Dockerfiles | |
permissions: | |
pull-requests: read | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v37 | |
build-containers: | |
if: ${{ fromJSON(needs.detect-changes.outputs.changed) }} | |
needs: detect-changes | |
runs-on: ubuntu-latest | |
name: Build containers | |
strategy: | |
matrix: ${{ fromJSON(needs.detect-changes.outputs.directories) }} | |
permissions: | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
if: github.event_name == 'push' | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- id: get-version | |
run: | | |
pip install tbump | |
echo "version=$(tbump -C dockerfiles/${{ matrix.directories }} current-version)" >> "$GITHUB_OUTPUT" | |
- run: | | |
pushd dockerfiles/${{ matrix.directories }} | |
export DOCKER_BUILDKIT=1 | |
make build | |
if [[ "${{ github.event_name }}" == "push" ]]; then | |
make push | |
fi |