Skip to content

tools: getting monorepo tools working and ensuring docker build still… #1

tools: getting monorepo tools working and ensuring docker build still…

tools: getting monorepo tools working and ensuring docker build still… #1

Workflow file for this run

name: Create and publish headbase-app/server Docker image
on:
push:
tags:
- 'server/**'
env:
REGISTRY: ghcr.io
IMAGE_NAME: headbase-app/server
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step will automatically tag the image will the git tag (e.g. v1.2.3 etc.)
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Strip 'server/' from the tag ref so output docker image version is just the version
tags: |
type=match,pattern=server/(.*),group=1
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true