Publish Docker image #3
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: Publish Docker image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dockerTag: | ||
description: 'Docker tag' | ||
required: true | ||
type: string | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ env.REGISTRY }}/${{ github.repository }} | ||
Check failure on line 13 in .github/workflows/publish-docker-image.yml GitHub Actions / Publish Docker imageInvalid workflow file
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'sbt' | ||
- run: sbt --mem 4096 --batch buildTarballsForDocker | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: docker/setup-buildx-action@v3 | ||
- uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
flavor: latest=false | ||
tags: type=raw,value=${{ inputs.dockerTag }} | ||
labels: | | ||
org.opencontainers.image.source=https://github.com/${{ github.repository }} | ||
org.opencontainers.image.licenses=MIT | ||
org.opencontainers.image.description="Unit Zero Node" | ||
- uses: docker/build-push-action@v5 | ||
id: push | ||
with: | ||
context: ./docker | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
pull: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
- uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |