Skip to content

Commit 09d7fd9

Browse files
A1L13NA1L13Nclaude
authored
Deploy the GSoC leaderboard instead of committing it to main (#1119)
main is protected by the repository ruleset, so the scheduled job's commit of gsoc/data/leaderboard.json is rejected. Generate the data and deploy gsoc directly every 6 hours, and regenerate it on every gsoc deploy so a deploy never ships stale numbers. Co-authored-by: A1L13N <nagnation@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent c117230 commit 09d7fd9

2 files changed

Lines changed: 31 additions & 19 deletions

File tree

‎.github/workflows/deploy-sites.yml‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,13 @@ jobs:
7070
with:
7171
python-version: "3.12"
7272

73-
- name: Build GSoC ideas page
73+
- name: Build GSoC ideas page and leaderboard
7474
if: matrix.project == 'gsoc'
75-
run: pip install markdown && python scripts/build_ideas.py
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
run: |
78+
pip install markdown && python scripts/build_ideas.py
79+
python scripts/generate_leaderboard.py
7680
7781
- name: Build
7882
if: hashFiles(format('{0}/package.json', matrix.project)) != ''
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
11
name: Generate GSoC leaderboard
22

3+
# main is protected, so the leaderboard is not committed. It is generated and
4+
# deployed straight to gsoc.alphaonelabs.com every 6 hours (and on every gsoc
5+
# deploy, see deploy-sites.yml).
6+
37
on:
48
schedule:
59
- cron: '0 */6 * * *'
610
workflow_dispatch:
711

812
permissions:
9-
contents: write
13+
contents: read
14+
15+
concurrency:
16+
group: deploy-gsoc
17+
cancel-in-progress: false
1018

1119
jobs:
12-
generate:
20+
generate-and-deploy:
1321
if: github.repository == 'alphaonelabs/website'
1422
runs-on: ubuntu-latest
23+
defaults:
24+
run:
25+
working-directory: gsoc
26+
env:
27+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
28+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
1529
steps:
1630
- uses: actions/checkout@v4
17-
1831
- uses: actions/setup-python@v5
1932
with:
20-
python-version: '3.11'
33+
python-version: '3.12'
34+
- uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
2137

2238
- name: Generate leaderboard data
23-
working-directory: gsoc
2439
env:
2540
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2641
run: python scripts/generate_leaderboard.py
2742

28-
- name: Commit and push if changed
29-
run: |
30-
git config user.name "github-actions[bot]"
31-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
32-
if git diff --quiet -- gsoc/data/leaderboard.json; then
33-
echo "No changes to commit"
34-
exit 0
35-
fi
36-
git add gsoc/data/leaderboard.json
37-
git commit -m "chore(gsoc): update leaderboard data"
38-
git pull --rebase --autostash origin main
39-
git push origin HEAD:main
43+
- name: Build GSoC ideas page
44+
run: pip install markdown && python scripts/build_ideas.py
45+
46+
- name: Deploy
47+
run: npx --yes wrangler@4.40.0 deploy

0 commit comments

Comments
 (0)