# This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation.
on: push: tags: -"v*"
env: # Use docker.io for Docker Hub if empty REGISTRY:docker.io # github.repository as <account>/<repo> IMAGE_NAME:${{github.repository}}
jobs: build:
runs-on:ubuntu-latest permissions: contents:read packages:write # This is used to complete the identity challenge # with sigstore/fulcio when running outside of PRs. id-token:write
# Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action -name:BuildandpushDockerimage id:build-and-push uses:docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context:. push:${{github.event_name!='pull_request'}} tags:${{steps.meta.outputs.tags}} labels:${{steps.meta.outputs.labels}}
-name:SignthepublishedDockerimage if:${{github.event_name!='pull_request'}} env: COSIGN_EXPERIMENTAL:"true" # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. run:cosignsign${{env.REGISTRY}}/${{env.IMAGE_NAME}}@${{steps.build-and-push.outputs.digest}}