feat: implement pngx-controller with Gitea CI/CD deployment
All checks were successful
Deploy / deploy (push) Successful in 30s
All checks were successful
Deploy / deploy (push) Successful in 30s
- 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>
This commit is contained in:
62
.gitea/workflows/deploy.yml
Normal file
62
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,62 @@
|
||||
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
|
||||
Reference in New Issue
Block a user