feat: add auto-incrementing version number (0.9.0.X) in footer
All checks were successful
Deploy to VPS / deploy (push) Successful in 38s
All checks were successful
Deploy to VPS / deploy (push) Successful in 38s
- Added version.json to track base version and build number - Updated Gitea Actions workflow to bump build number on each deploy - Footer now shows version number alongside commit hash - Version passed as build arg through Docker build pipeline Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -14,10 +14,24 @@ jobs:
|
||||
cd /home/remmer/StageAI
|
||||
git pull origin master
|
||||
|
||||
- name: Bump version
|
||||
run: |
|
||||
cd /home/remmer/StageAI
|
||||
BUILD=$(jq '.build' version.json)
|
||||
NEW_BUILD=$((BUILD + 1))
|
||||
VERSION=$(jq -r '.version' version.json)
|
||||
jq --arg b "$NEW_BUILD" '.build = ($b | tonumber)' version.json > version.tmp && mv version.tmp version.json
|
||||
echo "APP_VERSION=${VERSION}.${NEW_BUILD}" >> $GITHUB_ENV
|
||||
git config user.name "Gitea Actions"
|
||||
git config user.email "actions@gitea.local"
|
||||
git add version.json
|
||||
git commit -m "Bump build to ${VERSION}.${NEW_BUILD} [skip ci]"
|
||||
git push origin master
|
||||
|
||||
- name: Build and deploy
|
||||
run: |
|
||||
cd /home/remmer/StageAI
|
||||
export COMMIT_HASH=$(git rev-parse --short HEAD)
|
||||
docker compose build app
|
||||
docker compose build --build-arg COMMIT_HASH=$COMMIT_HASH --build-arg APP_VERSION=${{ env.APP_VERSION }} app
|
||||
docker compose up -d app
|
||||
echo "Deployed commit: $COMMIT_HASH"
|
||||
echo "Deployed version: ${{ env.APP_VERSION }} (commit: $COMMIT_HASH)"
|
||||
|
||||
Reference in New Issue
Block a user