@@ -9,9 +9,13 @@ permissions:
99 pages : write
1010 id-token : write
1111
12+ # Redeployment when repositories.txt changed recently. The build is cached
13+ # (actions/cache on .next/cache) to hit the <6 minute target.
1214jobs :
13- check-and-deploy :
15+ check :
1416 runs-on : ubuntu-latest
17+ outputs :
18+ changed : ${{ steps.check-changes.outputs.changed }}
1519 steps :
1620 - name : Checkout repository
1721 uses : actions/checkout@v4
@@ -36,17 +40,41 @@ jobs:
3640 echo "No recent changes, skipping deployment"
3741 fi
3842
39- - name : Setup Pages
40- if : steps.check-changes.outputs.changed == 'true'
41- uses : actions/configure-pages@v4
42-
43+ build :
44+ needs : check
45+ if : needs.check.outputs.changed == 'true'
46+ runs-on : ubuntu-latest
47+ steps :
48+ - uses : actions/checkout@v4
49+ - uses : oven-sh/setup-bun@v1
50+ with :
51+ bun-version : latest
52+ - uses : actions/setup-node@v4
53+ with :
54+ node-version : 22
55+ - name : Cache .next build cache
56+ uses : actions/cache@v4
57+ with :
58+ path : .next/cache
59+ key : ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock', '**/package.json') }}-${{ github.run_id }}
60+ restore-keys : ${{ runner.os }}-nextjs-${{ hashFiles('**/bun.lock', '**/package.json') }}-
61+ - run : bun install
62+ - name : Build static export
63+ run : bun run build
64+ env :
65+ NEXT_PUBLIC_HOSTING_ENVIRONMENT : github
4366 - name : Upload artifact
44- if : steps.check-changes.outputs.changed == 'true'
4567 uses : actions/upload-pages-artifact@v3
4668 with :
47- path : ' . '
69+ path : ' out '
4870
71+ deploy :
72+ needs : build
73+ environment :
74+ name : github-pages
75+ url : ${{ steps.deployment.outputs.page_url }}
76+ runs-on : ubuntu-latest
77+ steps :
4978 - name : Deploy to GitHub Pages
50- if : steps.check-changes.outputs.changed == 'true'
5179 id : deployment
52- uses : actions/deploy-pages@v4
80+ uses : actions/deploy-pages@v5
0 commit comments