name: CI
on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:
concurrency:
  group: ${{ github.head_ref || github.run_id }}
  cancel-in-progress: true
jobs:
  container:
    name: Build containers
    runs-on: ubuntu-latest
    strategy:
      fail-fast: true
      matrix:
        container-file:
          - containers/caddy/Containerfile
          - containers/web/node/Containerfile
          - containers/web/python/Containerfile
    steps:
      - uses: actions/checkout@v6
      - uses: docker/setup-buildx-action@v3
      - uses: docker/build-push-action@v6
        with:
          context: .
          file: ${{ matrix.container-file }}
          push: false
          cache-from: type=gha
          cache-to: type=gha,mode=max
