feat: add semver auto-increment and version display

- Add VERSION file (starts at 0.1.0)
- Deploy workflow bumps patch on every push, commits back [skip ci]
- APP_VERSION passed into container via env
- Version shown in page header next to title

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-08 11:51:35 +01:00
parent 7553790b5a
commit 89d21408e6
4 changed files with 23 additions and 2 deletions

View File

@@ -16,6 +16,23 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA_TOKEN }}
- name: Bump patch version
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: |
@@ -23,11 +40,12 @@ jobs:
OUTLINE_URL=http://172.29.0.13:3000
OUTLINE_TOKEN=${{ secrets.OUTLINE_TOKEN }}
TS_AUTHKEY=${{ secrets.TS_AUTHKEY }}
APP_VERSION=${{ env.APP_VERSION }}
EOF
- name: Deploy with docker compose
run: |
echo "=== Deploying commit ${{ gitea.sha }} to ${{ gitea.ref_name }} ==="
echo "=== Deploying ${{ env.APP_VERSION }} (commit ${{ gitea.sha }}) to ${{ gitea.ref_name }} ==="
docker compose -f "$COMPOSE_FILE" -p "$COMPOSE_PROJECT" up --build -d --remove-orphans
- name: Prune dangling images

1
VERSION Normal file
View File

@@ -0,0 +1 @@
0.1.0

View File

@@ -39,6 +39,7 @@ services:
environment:
- OUTLINE_URL=${OUTLINE_URL:-http://172.29.0.13:3000}
- OUTLINE_TOKEN=${OUTLINE_TOKEN}
- APP_VERSION=${APP_VERSION:-dev}
volumes:
tailscale-state:

View File

@@ -30,6 +30,7 @@ from pydantic import BaseModel, field_validator
VAULT_DIR: Path = Path(os.environ.get("VAULT_DIR", "/vault"))
SETTINGS_PATH: Path = Path(os.environ.get("SETTINGS_PATH", "/work/settings.json"))
APP_VERSION: str = os.environ.get("APP_VERSION", "dev")
# ---------------------------------------------------------------------------
# App + job state
@@ -441,7 +442,7 @@ def _page(title: str, body: str) -> str:
<style>{_BASE_CSS}</style></head>
<body>
<header>
<h1>Outline Sync</h1>
<h1>Outline Sync <small style="font-size:.55em;color:#aaa;font-weight:400">v{APP_VERSION}</small></h1>
<nav>
<a href="/">Dashboard</a>
<a href="/changes">Changes</a>