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