Files
pngx-sync/.gitea/workflows/deploy.yml
domverse b99dbf694d
All checks were successful
Deploy / deploy (push) Successful in 30s
feat: implement pngx-controller with Gitea CI/CD deployment
- Full FastAPI sync engine: master→replica document sync via paperless REST API
- Web UI: dashboard, replicas, logs, settings (Jinja2 + HTMX + Pico CSS)
- APScheduler background sync, SSE live log stream, Prometheus metrics
- Fernet encryption for API tokens at rest
- pngx.env credential file: written on save, pre-fills forms on load
- Dockerfile with layer-cached uv build, Python healthcheck
- docker-compose with host networking for Tailscale access
- Gitea Actions workflow: version bump, secret injection, docker compose deploy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 17:59:25 +01:00

63 lines
1.9 KiB
YAML

name: Deploy
on:
push:
branches:
- main
workflow_dispatch:
inputs:
reason:
description: "Reason for manual deploy"
required: false
default: "manual"
env:
COMPOSE_PROJECT: pngx-controller
COMPOSE_FILE: docker-compose.yml
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA_TOKEN }}
- name: Bump patch version
if: github.event_name != 'workflow_dispatch'
run: |
VERSION=$(cat VERSION)
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
PATCH=$(echo $VERSION | cut -d. -f3)
NEW_VERSION="$MAJOR.$MINOR.$((PATCH + 1))"
echo $NEW_VERSION > VERSION
echo "APP_VERSION=$NEW_VERSION" >> $GITHUB_ENV
git config user.email "ci@domverse-berlin.eu"
git config user.name "CI"
git add VERSION
git commit -m "chore: bump version to $NEW_VERSION [skip ci]"
git push
- name: Write .env
run: |
cat > .env << EOF
SECRET_KEY=${{ secrets.PNGX_SECRET_KEY }}
MASTER_URL=${{ secrets.PNGX_MASTER_URL }}
MASTER_TOKEN=${{ secrets.PNGX_MASTER_TOKEN }}
EOF
- name: Deploy with docker compose
run: |
APP_VERSION=${APP_VERSION:-$(cat VERSION)}
echo "=== Deploying $APP_VERSION (commit ${{ gitea.sha }}) to ${{ gitea.ref_name }} ==="
docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" build --build-arg APP_VERSION=$APP_VERSION
docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" up -d --remove-orphans
- name: Prune dangling images
run: docker image prune -f
- name: Show running containers
run: docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" ps