Skip to content

Commit e54d71e

Browse files
committed
chore(deploy): fix up github pages deploy
1 parent f365d10 commit e54d71e

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

.github/workflows/ci.yml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,20 @@ on:
55
branches: [develop]
66
pull_request:
77
branches: [develop]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: pages
17+
cancel-in-progress: false
818

919
jobs:
10-
build-and-deploy:
20+
build:
1121
runs-on: ubuntu-latest
12-
permissions:
13-
contents: write
14-
1522
steps:
1623
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1724

@@ -22,9 +29,21 @@ jobs:
2229
- name: Use Node.js
2330
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2431
with:
25-
node-version: '22'
32+
node-version: '20'
2633
cache: pnpm
2734

35+
- name: Setup Pages
36+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
37+
38+
- name: Restore cache
39+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
40+
with:
41+
path: |
42+
.next/cache
43+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
44+
restore-keys: |
45+
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-
46+
2847
- name: Install dependencies
2948
run: pnpm install
3049

@@ -37,12 +56,20 @@ jobs:
3756
- name: Build
3857
run: pnpm run build
3958

40-
- name: Deploy
59+
- name: Upload artifact
4160
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
42-
uses: JamesIves/github-pages-deploy-action@9d877eea73427180ae43cf98e8914934fe157a1a # v4.7.6
61+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
4362
with:
44-
branch: publish
45-
folder: out
46-
clean: true
47-
git-config-name: GitHub Actions
48-
git-config-email: [email protected]
63+
path: ./out
64+
65+
deploy:
66+
environment:
67+
name: github-pages
68+
url: ${{ steps.deployment.outputs.page_url }}
69+
runs-on: ubuntu-latest
70+
needs: build
71+
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
72+
steps:
73+
- name: Deploy to GitHub Pages
74+
id: deployment
75+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

0 commit comments

Comments
 (0)