Publish image #4
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: Publish image | |
on: | |
workflow_dispatch: | |
inputs: | |
image: | |
description: "The OCI image name. This must not include a tag or digest." | |
type: string | |
default: "docker.io/laurentsimon/oss-na24-slsa-workshop-project1-echo-server" | |
digest: | |
description: "The OCI image digest. The image digest of the form '<algorithm>:<digest>' (e.g. 'sha256:abcdef...')" | |
type: string | |
default: "sha256:51c374c1af56022fdc75aec399d9694e1559338544d78b788a515bdd7278ebf5" | |
environment: | |
type: choice | |
description: Environment to use | |
options: | |
- prod | |
- staging | |
permissions: read-all | |
defaults: | |
run: | |
shell: bash | |
env: | |
IMAGE_REGISTRY: docker.io | |
IMAGE_NAME: ${{ github.repository }}-echo-server | |
jobs: | |
publish: | |
permissions: | |
id-token: write # for creating OIDC tokens for signing. | |
packages: write # for uploading attestations. | |
contents: read # To read the repo. | |
uses: slsa-framework/oss-na24-slsa-workshop-organization/.github/workflows/image-publisher.yml@main | |
with: | |
environment: ${{ inputs.environment }} | |
image: ${{ inputs.image }} | |
digest: ${{ inputs.digest }} | |
# Use name rather than env variable because env are not available for reusable workflows. | |
registry-username: laurentsimon | |
#registry-username: ${{ github.actor }} | |
secrets: | |
registry-password: ${{ secrets.REGISTRY_PASSWORD }} | |
#registry-password: ${{ secrets.GITHUB_TOKEN }} |