Skip to content

CR

CR #98

Workflow file for this run

name: CR
on:
push:
branches: [main]
paths:
- 'build-aux/docker/Dockerfile'
- 'build-aux/docker/Dockerfile.toolbox'
pull_request:
paths:
- 'build-aux/docker/Dockerfile'
- 'build-aux/docker/Dockerfile.toolbox'
schedule:
# Once a week to keep dependencies up to date
- cron: 0 0 * * 0
workflow_dispatch:
permissions:
contents: read
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Docker
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
label:
- CI
- Toolbox
include:
- label: CI
file: ./build-aux/docker/Dockerfile
image: ghcr.io/${{ github.repository }}
- label: Toolbox
file: ./build-aux/docker/Dockerfile.toolbox
image: ghcr.io/${{ github.repository }}-toolbox
fail-fast: false
steps:
- name: Metadata
id: metadata
uses: docker/metadata-action@v4
with:
images: ${{ matrix.image }}
tags: |
# set latest tag for main branch
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
- name: Login
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}
- name: Build
uses: docker/build-push-action@v4
with:
file: ${{ matrix.file }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}