1- # Unified workflow to crawl publications, team photos, and apply LTS security patches
1+ # Weekly maintenance: apply LTS security patches and prune stale Keystatic branches.
2+ # Crawling hadylauw.com (publications, team photos) lives in update-publications-and-team.yml.
23name : Scheduled Maintenance
34
45on :
5- # Run every Sunday at 00:00 UTC
6+ # Run every Sunday at 06:00 UTC (14:00 Singapore time), 12h after the daily
7+ # publications & team photos sync (18:00 UTC) so the two never overlap
68 schedule :
7- - cron : " 0 0 * * 0"
9+ - cron : " 0 6 * * 0"
810
911 push :
1012 branches : ["main"]
1113 paths :
1214 - " .github/workflows/scheduled-maintenance.yml"
13- - " scripts/crawl-publications.ts"
14- - " scripts/crawl-team.ts"
1515
16- # Allow manual trigger with selective options
16+ # Allow manual trigger
1717 workflow_dispatch :
18- inputs :
19- skip_crawlers :
20- description : " Skip crawling external sites (security update only)"
21- type : boolean
22- default : false
2318
2419permissions :
2520 contents : write
2621 pull-requests : read
2722
23+ # Shared with update-publications-and-team.yml so bot pushes to main never race
24+ concurrency :
25+ group : main-bot-writes
26+ cancel-in-progress : false
27+
2828jobs :
2929 maintenance :
3030 runs-on : ubuntu-latest
@@ -47,24 +47,11 @@ jobs:
4747 - name : Install dependencies
4848 run : pnpm install --frozen-lockfile
4949
50- - name : Run external crawlers concurrently
51- if : ${{ !inputs.skip_crawlers }}
52- run : |
53- pnpm crawl:publications &
54- PID_PUB=$!
55- pnpm crawl:team &
56- PID_TEAM=$!
57- wait $PID_PUB $PID_TEAM
58-
5950 - name : Auto-patch security vulnerabilities
6051 run : |
6152 pnpm audit --fix update || true
6253 pnpm install
6354
64- - name : Format generated publication and team data
65- run : |
66- pnpm exec biome check --write src/data/publications.ts src/data/teamPhotos.ts || true
67-
6855 - name : Validate application integrity
6956 run : |
7057 pnpm lint
7663 - name : Check for changes
7764 id : check-changes
7865 run : |
79- git add src/data/publications.ts src/data/teamPhotos.ts public/team pnpm-lock.yaml pnpm-workspace.yaml package.json apps/admin/package.json
66+ git add pnpm-lock.yaml pnpm-workspace.yaml package.json apps/admin/package.json
8067 git diff --cached --quiet || echo "changed=true" >> $GITHUB_OUTPUT
8168
8269 - name : Commit and push changes
8572 git config --local user.email "github-actions[bot]@users.noreply.github.com"
8673 git config --local user.name "github-actions[bot]"
8774
88- changes=()
89- ! git diff --cached --quiet src/data/publications.ts && changes+=("publications")
90- ! git diff --cached --quiet src/data/teamPhotos.ts public/team && changes+=("team photos")
91- ! git diff --cached --quiet pnpm-lock.yaml pnpm-workspace.yaml package.json apps/admin/package.json && changes+=("security patches")
92-
93- msg="chore: update $(IFS=', '; echo "${changes[*]}") [automated]"
94- git commit -m "$msg"
75+ git commit -m "chore: update security patches [automated]"
76+ git pull --rebase origin main
9577 git push
9678
9779 - name : Trigger deploy notice
0 commit comments