git-cache-proxy 0.1.4

Read-only caching proxy for Git: serves clones/fetches from an in-region mirror, pulling only deltas from upstream.
Documentation
name: Package

# On every packaging change, build the image (no push) so breakage is caught before a
# release. Publishing the versioned image to GHCR happens in the Release workflow, in the
# same run that cuts the release.

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

jobs:
  changes:
    name: Detect changes
    runs-on: ubuntu-latest
    outputs:
      pkg: ${{ steps.filter.outputs.pkg }}
    steps:
      - uses: actions/checkout@v4
      - uses: dorny/paths-filter@v3
        id: filter
        with:
          filters: |
            pkg:
              - 'src/**'
              - 'Cargo.toml'
              - 'Cargo.lock'
              - 'Dockerfile'
              - '.dockerignore'
              - '.github/workflows/package.yml'

  validate:
    name: Build image
    needs: changes
    if: needs.changes.outputs.pkg == 'true'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: docker/setup-buildx-action@v3
      - name: Build image (no push)
        uses: docker/build-push-action@v6
        with:
          context: .
          file: Dockerfile
          push: false
          cache-from: type=gha
          cache-to: type=gha,mode=max