Skip to content

Merge: fix client SPA static path in Docker image (#5) #4

Merge: fix client SPA static path in Docker image (#5)

Merge: fix client SPA static path in Docker image (#5) #4

Workflow file for this run

name: Publish image
on:
push:
branches: [main]
tags: ["v*"]
jobs:
publish:
name: Build and push to GHCR
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# GHCR image names must be lowercase; the owner may not be.
- name: Compute lowercase image name
id: img
run: echo "name=ghcr.io/${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"
- name: Docker metadata (tags/labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.img.outputs.name }}
flavor: latest=false
# Use explicit ref checks rather than {{is_default_branch}} — the
# repo's default branch isn't necessarily `main`, which would leave
# a push to main with zero tags (and buildx refuses to push then).
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=edge,enable=${{ github.ref == 'refs/heads/main' }}
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: server/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max