Skip to content

Commit a2abd7a

Browse files
committed
ci: use official github pages action
1 parent 8472852 commit a2abd7a

1 file changed

Lines changed: 27 additions & 13 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,47 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches:
6-
- main
5+
branches: ["main"]
6+
workflow_dispatch:
77

88
permissions:
9-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: true
1016

1117
jobs:
12-
build-and-deploy:
18+
build:
1319
runs-on: ubuntu-latest
1420
steps:
1521
- name: Checkout
1622
uses: actions/checkout@v4
17-
1823
- name: Setup Node
1924
uses: actions/setup-node@v4
2025
with:
2126
node-version: 18
2227
cache: 'npm'
23-
24-
- name: Install Dependencies
28+
- name: Install dependencies
2529
run: npm ci
26-
2730
- name: Build
2831
run: npm run build
29-
30-
- name: Deploy
31-
uses: peaceiris/actions-gh-pages@v3
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v4
34+
- name: Upload artifact
35+
uses: actions/upload-pages-artifact@v3
3236
with:
33-
github_token: ${{ secrets.GITHUB_TOKEN }}
34-
publish_dir: ./dist
37+
path: './dist'
38+
39+
deploy:
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
runs-on: ubuntu-latest
44+
needs: build
45+
steps:
46+
- name: Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)