Skip to content

Publish Docker image #4

Publish Docker image

Publish Docker image #4

name: Publish Docker image
on:
workflow_dispatch:
inputs:
dockerTag:
description: 'Docker tag'
required: true
type: string
baseImage:
description: 'Base image'
required: true
default: 'eclipse-temurin:11-jre-noble'
type: string
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 20
fetch-tags: true
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'sbt'
- uses: sbt/setup-sbt@v1
- run: sbt --mem 4096 --batch buildTarballsForDocker
- uses: docker/login-action@v3
with:
registry: ghcr.io
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="Waves Node"
- uses: docker/build-push-action@v5
id: push
with:
context: ./docker
platforms: linux/amd64,linux/arm64
push: true
pull: true
build-args: baseImage=${{ inputs.baseImage }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max