Skip to content

Commit 83f862b

Browse files
committed
chore(ci): upgrade actions and pages deploy
1 parent b551eee commit 83f862b

File tree

2 files changed

+52
-27
lines changed

2 files changed

+52
-27
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,24 @@ on:
66
jobs:
77
build:
88
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
env:
12+
CI: true
913
steps:
10-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v5
18+
with:
19+
version: latest
1120

1221
- name: Use Node.js LTS
1322
uses: actions/setup-node@v6
1423
with:
1524
node-version: lts/*
1625
check-latest: true
17-
18-
- name: Setup pnpm
19-
uses: pnpm/action-setup@v2
20-
with:
21-
version: latest
26+
cache: pnpm
2227

2328
- name: Build project
2429
run: |

.github/workflows/deploy.yml

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,47 @@ on:
44
push:
55
branches: [main]
66
workflow_dispatch:
7-
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: true
816

917
jobs:
1018
build:
1119
runs-on: ubuntu-latest
20+
env:
21+
CI: true
1222

1323
steps:
14-
- uses: actions/checkout@v4
15-
24+
- uses: actions/checkout@v6
25+
26+
- name: Configure GitHub Pages
27+
uses: actions/configure-pages@v5
28+
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v5
31+
with:
32+
version: latest
33+
1634
- name: Use Node.js LTS
1735
uses: actions/setup-node@v6
1836
with:
1937
node-version: lts/*
2038
check-latest: true
39+
cache: pnpm
2140

22-
- name: Setup pnpm
23-
uses: pnpm/action-setup@v2
24-
with:
25-
version: latest
26-
27-
- name: Setup pnpm cache
28-
uses: actions/cache@v4
41+
- name: Setup Next.js cache
42+
uses: actions/cache@v5
2943
with:
30-
path: |
31-
~/.pnpm-store
32-
.next/cache
33-
key: ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
path: .next/cache
45+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}
3446
restore-keys: |
35-
${{ runner.os }}-pnpm-nextjs-
47+
${{ runner.os }}-nextjs-
3648
3749
- name: Install dependencies
3850
run: pnpm install
@@ -48,10 +60,18 @@ jobs:
4860
run: |
4961
echo "mx-space.js.org" > out/CNAME
5062
51-
- name: Deploy
52-
uses: peaceiris/actions-gh-pages@v4
63+
- name: Upload GitHub Pages artifact
64+
uses: actions/upload-pages-artifact@v4
5365
with:
54-
github_token: ${{ secrets.GITHUB_TOKEN }}
55-
publish_dir: out
56-
env:
57-
CI: true
66+
path: out
67+
68+
deploy:
69+
runs-on: ubuntu-latest
70+
needs: build
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
74+
steps:
75+
- name: Deploy to GitHub Pages
76+
id: deployment
77+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)