Skip to content

Commit e363e18

Browse files
MaxGhenisclaude
andcommitted
Split data fetch into separate workflow
- deploy.yml: just build + deploy (fast, ~30s) - refresh-data.yml: fetch GitHub data + commit (manual/weekly) - Data file will be committed to repo instead of generated each deploy 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent db9264c commit e363e18

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ jobs:
2929
- name: Install dependencies
3030
run: npm ci
3131

32-
- name: Fetch GitHub data
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35-
run: node scripts/fetch-data.js
36-
3732
- name: Build
3833
run: npm run build
3934

.github/workflows/refresh-data.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Refresh GitHub Data
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# Weekly on Mondays at 6am UTC
7+
- cron: '0 6 * * 1'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
refresh:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
23+
- name: Fetch GitHub data
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: node scripts/fetch-data.js
27+
28+
- name: Commit updated data
29+
run: |
30+
git config user.name "github-actions[bot]"
31+
git config user.email "github-actions[bot]@users.noreply.github.com"
32+
git add public/github-data.json
33+
git diff --staged --quiet || git commit -m "Update GitHub activity data [automated]"
34+
git push

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ dist
1212
dist-ssr
1313
*.local
1414

15-
# Generated data (run scripts/fetch-data.js to create)
16-
public/github-data.json
15+
# Generated data is now committed (refreshed via workflow)
1716

1817
# Editor directories and files
1918
.vscode/*

0 commit comments

Comments
 (0)