From cd2afe5deaff41c460dc1d5b7e19d80f0aaececd Mon Sep 17 00:00:00 2001 From: grabowski Date: Thu, 9 Jul 2026 14:47:48 +0700 Subject: [PATCH] Auto-bump the website submodule pointer on every data push A push here commits the new pointer to buildfor_life_web (via WEB_REPO_TOKEN), which triggers the site deploy. No more manual bump commits, and re-measures deploy without any web-repo change. --- .gitea/workflows/bump-website.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .gitea/workflows/bump-website.yml diff --git a/.gitea/workflows/bump-website.yml b/.gitea/workflows/bump-website.yml new file mode 100644 index 0000000..c5b7fa7 --- /dev/null +++ b/.gitea/workflows/bump-website.yml @@ -0,0 +1,33 @@ +name: Bump website submodule + +# Every push here auto-commits the new submodule pointer to buildfor_life_web, +# which triggers the site deploy. This keeps the web repo's pointer truthful +# (reproducible builds) without anyone having to remember the bump commit. +# Requires the WEB_REPO_TOKEN secret (Gitea token, write:repository). + +on: + push: + branches: [main] + +jobs: + bump: + runs-on: ubuntu-latest + steps: + - name: Update submodule pointer in buildfor_life_web + env: + # via env so quotes/backticks in commit messages can't break the shell + HEAD_MSG: ${{ github.event.head_commit.message }} + DATA_SHA: ${{ github.sha }} + run: | + git clone --depth 1 "https://x:${{ secrets.WEB_REPO_TOKEN }}@git.b4l.co.th/B4L/buildfor_life_web.git" web + cd web + git config user.name "comparison-data" + git config user.email "grabowski@b4l.co.th" + git update-index --add --cacheinfo "160000,$DATA_SHA,apps/web/comparison-data" + if git diff --cached --quiet; then + echo "Pointer already at $DATA_SHA - nothing to do" + exit 0 + fi + subject=$(printf '%s\n' "$HEAD_MSG" | head -n 1) + git commit -m "Bump comparison-data to ${DATA_SHA:0:7} (auto)" -m "$subject" + git push