Files
padelnomics/.gitea/workflows/ci.yaml
Deeman aee3733b49
All checks were successful
CI / test (push) Successful in 48s
CI / tag (push) Successful in 2s
fix(supervisor+ci): self-restart on deploy, CI creates date-based tags
supervisor: after git checkout + uv sync, os.execv replaces the running
process so new code takes effect immediately without a manual systemd
restart. systemd sees the same PID, so the unit stays "active".

ci: changed tag format from v{run_number} to v{YYYYMMDDHHMM}, matching
the supervisor's deploy tag convention. Sequential v<N> tags conflicted
with manual date-based tags causing an infinite redeploy loop.
No more manual tagging needed — CI tags automatically after green tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 21:02:30 +01:00

38 lines
1003 B
YAML

name: CI
on:
push:
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: https://github.com/astral-sh/setup-uv@v5
with:
python-version: "3.12"
- run: uv sync
- run: uv run pytest web/tests/ -x -q -p no:faulthandler
- run: uv run ruff check web/src/ web/tests/
# Creates a v{YYYYMMDDHHMM} tag after tests pass on master.
# The on-server supervisor polls for new tags every 60s and deploys
# automatically. No SSH keys or deploy credentials needed in CI.
tag:
needs: [test]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
with:
token: ${{ github.token }}
- name: Create and push tag
run: |
git config user.name "CI"
git config user.email "ci@noreply"
TAG="v$(date -u +%Y%m%d%H%M)"
git tag "$TAG"
git push origin "$TAG"