Merge remote-tracking branch 'origin/main' #1
This file contains hidden or 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
| # CI workflow: builds images and pushes to GHCR for validation. | |
| # For Cloud Run deployment images, use `pixi run cloud-build-images` which | |
| # pushes to GCR via Google Cloud Build (see deployment/cloud/gcp/cloudbuild.yaml). | |
| name: Build and Push Docker Images | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - "resources/docker/**" | |
| - "src/**" | |
| - "pixi.toml" | |
| - "pixi.lock" | |
| - ".github/workflows/docker-build.yml" | |
| release: | |
| types: [published] | |
| pull_request: | |
| paths: | |
| - "resources/docker/**" | |
| - "src/**" | |
| - "pixi.toml" | |
| - "pixi.lock" | |
| - ".github/workflows/docker-build.yml" | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_BASE: ghcr.io/${{ github.repository }} | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - dockerfile: resources/docker/pipeline.dockerfile | |
| image_name: pipeline | |
| - dockerfile: resources/docker/webservice.dockerfile | |
| image_name: webservice | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate image metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_BASE }}/${{ matrix.image_name }} | |
| tags: | | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| type=sha,prefix= | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| platforms: linux/amd64 |