Skip to content

Update sbt-github-pages to 0.18.1 #480

Update sbt-github-pages to 0.18.1

Update sbt-github-pages to 0.18.1 #480

Workflow file for this run

name: Docker
on:
push:
branches:
- main
tags:
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-push-image:
runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
id-token: write
attestations: write
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Coursier cache
uses: coursier/cache-action@v7
- uses: taiki-e/install-action@parse-changelog
- name: Set build timestamp
run: echo "SOURCE_DATE_EPOCH=$(date -d $(parse-changelog CHANGELOG.md -t | rev | cut -d' ' -f1 | rev) '+%s')" >> "$GITHUB_ENV"
- uses: coursier/setup-action@v2
with:
jvm: zulu:11.0.10
apps: sbt scala
- name: Docker cache
id: cache-primes
uses: actions/cache@v5
with:
path: docker-cache
key: docker-cache
- name: Compile and prepare Docker configuration
run: sbt Docker/stage
env:
GITHUB_TOKEN: ${{ secrets.GH_PERSONAL_TOKEN }}
- name: Set up Docker Buildx
uses: useblacksmith/setup-docker-builder@v1
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5.10.0
with:
images: michaelmior/jsonoid-discovery
tags: |
# semver tags
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Build image
uses: useblacksmith/build-push-action@v2
env:
DOCKER_BUILD_NO_SUMMARY: true
with:
context: ./target/docker/stage
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: false
- name: Test image
env:
DOCKER_TAG: ${{ steps.meta.outputs.tags }}
run: (echo '{}' | docker run --rm -i $(echo "$DOCKER_TAG" | head -1) > /dev/null) && echo "OK"
- name: Build and push image
uses: useblacksmith/build-push-action@v2
id: push
with:
context: ./target/docker/stage
sbom: true
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Attest
uses: actions/attest-build-provenance@v3
id: attest
with:
subject-name: index.docker.io/michaelmior/jsonoid-discovery
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true