66 pull_request :
77 branches : [ main ]
88
9- permissions :
10- contents : read
11- pages : write
12- id-token : write
13-
14- concurrency :
15- group : " pages"
16- cancel-in-progress : true
17-
189jobs :
19- typecheck :
20- runs-on : ubuntu-latest
21- steps :
22- - name : Checkout
23- uses : actions/checkout@v4
24-
25- - name : Setup Node.js
26- uses : actions/setup-node@v4
27- with :
28- node-version : ' 22'
29- cache : ' npm'
30-
31- - name : Install dependencies
32- run : npm ci
33-
34- - name : Run type check
35- run : npm run check
36-
3710 build :
3811 runs-on : ubuntu-latest
3912
@@ -50,53 +23,46 @@ jobs:
5023 - name : Install dependencies
5124 run : npm ci
5225
53- - name : Cache embeddings and blog context
54- uses : actions/cache@v4
55- id : cache-embeddings
56- with :
57- path : |
58- dist/static/data/vectors.json
59- dist/static/data/index.json
60- dist/static/data/.content-hash
61- key : embeddings-${{ hashFiles('src/content/posts/**/*.md', 'src/pages/about.md', 'src/content/resume.*') }}
62- restore-keys : |
63- embeddings-
64-
65- - name : Restore cached files
66- if : steps.cache-embeddings.outputs.cache-hit == 'true'
67- run : |
68- echo "✅ Using cached embeddings and blog context"
69- mkdir -p dist/static/data dist/static/js
70-
71- - name : Cache transformer models
72- uses : actions/cache@v4
73- with :
74- path : ~/.cache/huggingface
75- key : transformers-${{ hashFiles('**/package-lock.json') }}
76- restore-keys : |
77- transformers-
26+ - name : Run type check
27+ run : npm run check
7828
7929 - name : Build site
8030 run : npm run build
8131 env :
8232 NODE_ENV : production
8333
84- - name : Setup Pages
85- uses : actions/configure-pages@v4
86-
87- - name : Upload artifact
88- uses : actions/upload-pages-artifact@v3
34+ - name : Upload build output
35+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
36+ uses : actions/upload-artifact@v4
8937 with :
90- path : ' ./dist'
38+ name : dist
39+ path : dist
9140
9241 deploy :
42+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
43+ permissions :
44+ pages : write
45+ id-token : write
9346 environment :
9447 name : github-pages
9548 url : ${{ steps.deployment.outputs.page_url }}
9649 runs-on : ubuntu-latest
9750 needs : build
9851 steps :
52+ - name : Download build output
53+ uses : actions/download-artifact@v4
54+ with :
55+ name : dist
56+ path : dist
57+
58+ - name : Setup Pages
59+ uses : actions/configure-pages@v4
60+
61+ - name : Upload artifact
62+ uses : actions/upload-pages-artifact@v3
63+ with :
64+ path : ' ./dist'
65+
9966 - name : Deploy to GitHub Pages
10067 id : deployment
10168 uses : actions/deploy-pages@v4
102-
0 commit comments