Skip to content

Commit 26f96ad

Browse files
committed
ci: deploy vitepress site
1 parent 2a59ace commit 26f96ad

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,34 @@ jobs:
44
build:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/setup-node@v2
7+
- uses: actions/checkout@v6
88
with:
9-
node-version: "16"
10-
- uses: actions/checkout@v2.3.1
11-
- run: (cd website && npm ci)
12-
- run: (cd website && npm run format:test)
13-
- run: (cd website && npm run build)
14-
- uses: JamesIves/github-pages-deploy-action@4.1.4
15-
if: github.ref == 'refs/heads/master'
9+
fetch-depth: 0
10+
- uses: actions/setup-node@v6
1611
with:
17-
branch: gh-pages
18-
folder: website/build/website
12+
node-version: 25
13+
cache: yarn
14+
cache-dependency-path: yarn.lock
15+
- run: yarn install --frozen-lockfile
16+
- run: yarn format:test
17+
- run: yarn build
18+
- uses: actions/configure-pages@v5
19+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
20+
- uses: actions/upload-pages-artifact@v3
21+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
22+
with:
23+
path: .vitepress/dist
24+
deploy:
25+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
26+
needs: build
27+
permissions:
28+
pages: write
29+
id-token: write
30+
environment:
31+
name: github-pages
32+
url: ${{ steps.deployment.outputs.page_url }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Deploy
36+
id: deployment
37+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)