Bump website submodule / bump (push) Successful in 52s
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.
34 lines
1.3 KiB
YAML
34 lines
1.3 KiB
YAML
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
|