Merge pull request #122 from docker/dependabot/github_actions/peter-e… #297
Workflow file for this run
This file contains 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
name: ci | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- 'v*' | |
pull_request: | |
env: | |
DOCKERHUB_SLUG: docker/buildkit-syft-scanner | |
BUILDX_VERSION: latest | |
BUILDKIT_IMAGE: moby/buildkit:latest | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Login to DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }} | |
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }} | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: ${{ env.BUILDX_VERSION }} | |
driver-opts: image=${{ env.BUILDKIT_IMAGE }} | |
buildkitd-flags: --debug | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ env.DOCKERHUB_SLUG }} | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=ref,event=pr | |
type=edge | |
labels: | | |
org.opencontainers.image.title=BuildKit Syft scanner | |
org.opencontainers.image.description=SBOM generation for BuildKit images | |
org.opencontainers.image.vendor=Docker Inc. | |
- | |
name: Build | |
uses: docker/bake-action@v6 | |
with: | |
files: | | |
./docker-bake.hcl | |
cwd://${{ steps.meta.outputs.bake-file }} | |
targets: image-all | |
push: ${{ github.event_name != 'pull_request' }} | |
set: | | |
*.cache-from=type=gha,scope=image | |
*.cache-to=type=gha,scope=image,mode=max | |
*.attest=type=sbom | |
dockerhub-readme: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' | |
needs: | |
- build | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
- | |
name: Update repo description | |
uses: peter-evans/dockerhub-description@v4 | |
with: | |
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }} | |
password: ${{ secrets.DOCKERPUBLICBOT_DELETE_PAT }} | |
repository: ${{ env.DOCKERHUB_SLUG }} |