Skip to content

Fix build

Fix build #3

Workflow file for this run

---
name: 'build container images'
on:
pull_request:
push:
branches:
- master
tags:
- '*'
concurrency:
group: ci-image-${{ github.head_ref || github.ref }}-${{ github.repository }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
project: [duckduckgo]
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@032a4b3bda1b716928481836ac5bfe36e1feaad6
with:
images: |
ghcr.io/${{ github.repository }}/${{ matrix.project }}
tags: |
type=semver,pattern={{raw}}
type=ref,event=branch
flavor: |
latest=auto
prefix=
suffix=
- name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PROJECT_NAME=${{ matrix.project }}
cache-from: type=gha,scope=${{ matrix.project }}-ci-image-${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=${{ matrix.project }}-ci-image-${{ github.ref_name }}
- name: Build PR
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: ./
file: ./Dockerfile
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
PROJECT_NAME=${{ matrix.project }}
cache-from: type=gha,scope=${{ matrix.project }}-ci-image-main