2a623e0b9c
Build and push image / build (push) Failing after 2m5s
- Multi-stage Dockerfile builds server + web into a single node:20-alpine image; runtime serves API on /api and the SPA from /app/public. - Express now serves web/dist with an SPA fallback that skips /api so API misses still 404 cleanly. - docker-compose.yml is a single-service deploy with a named volume for the SQLite database at /data/apothecary.db. - .gitea/workflows/build.yml pushes :latest, :<sha>, and :semver tags to the Gitea container registry on main and v* tags. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 lines
1.0 KiB
YAML
41 lines
1.0 KiB
YAML
name: Build and push image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.thewrightserver.net
|
|
username: ${{ gitea.repository_owner }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.thewrightserver.net/josh/apothecary
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=sha,prefix=,format=short
|
|
type=semver,pattern={{version}}
|
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
|
|
- uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|