mirror of
https://github.com/trailofbits/buttercup
synced 2026-06-21 14:11:39 +00:00
7739f7907d
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
name: Docker Build and Push
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
push:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
suffix:
|
|
required: false
|
|
type: string
|
|
default: ""
|
|
release:
|
|
types: [created]
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
types: [labeled, synchronize]
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
BASE_IMAGE_NAME: ${{ github.repository }}/buttercup
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- component: orchestrator
|
|
dockerfile: ./orchestrator/Dockerfile
|
|
- component: fuzzer
|
|
dockerfile: ./fuzzer/dockerfiles/runner_image.Dockerfile
|
|
- component: patcher
|
|
dockerfile: ./patcher/Dockerfile
|
|
- component: seed-gen
|
|
dockerfile: ./seed-gen/Dockerfile
|
|
- component: program-model
|
|
dockerfile: ./program-model/Dockerfile
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
persist-credentials: false
|
|
submodules: true
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to the Container registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}-${{ matrix.component }}
|
|
tags: |
|
|
type=ref,event=branch,suffix=${{ inputs.suffix }}
|
|
type=ref,event=pr,suffix=${{ inputs.suffix }}
|
|
type=ref,event=tag,suffix=${{ inputs.suffix }}
|
|
type=semver,pattern={{version}},suffix=${{ inputs.suffix }}
|
|
type=semver,pattern={{major}}.{{minor}},suffix=${{ inputs.suffix }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ${{ matrix.dockerfile }}
|
|
push: ${{ (github.event_name != 'pull_request' || startsWith(github.head_ref, 'ci/') || inputs.push || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'docker-push'))) && 'true' || 'false' }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
env:
|
|
DOCKER_BUILD_RECORD_RETENTION_DAYS: ${{ github.ref_type == 'tag' || github.event_name == 'release' && '0' || '7' }}
|