Skip to content

Update docker-build.yml #689

Update docker-build.yml

Update docker-build.yml #689

Workflow file for this run

name: Build and Push Docker Images with Attestation
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
service: [worker-cli, server, worker]
include:
- service: server
dockerfile: docker/docker/server/Dockerfile
context: docker/docker/server
component: server
- service: worker
dockerfile: docker/docker/worker/Dockerfile
context: docker/docker/worker
component: worker
- service: worker-cli
dockerfile: docker/docker/worker-cli/Dockerfile
context: docker/docker/worker-cli
component: worker-cli
permissions:
id-token: write
packages: write
contents: read
attestations: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Login to Docker Hub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Docker image
id: push
uses: docker/[email protected]
with:
context: ${{ matrix.context }}
file: ${{ matrix.dockerfile }}
platforms: linux/amd64, linux/arm64
push: true
tags: |
sunsolution/betterscan-${{ matrix.component }}:latest
sunsolution/betterscan-${{ matrix.component }}:${{ github.sha }}
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
id: attest
with:
subject-name: sunsolution/betterscan-${{ matrix.component }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true