Skip to content

Commit f3e2206

Browse files
committed
ci: gh pages
1 parent 25836e4 commit f3e2206

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

.github/workflows/deploy.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,53 @@ name: Deploy to GitHub Pages
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66

77
permissions:
88
contents: read
99
pages: write
1010
id-token: write
1111

12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
15+
1216
jobs:
13-
build-and-deploy:
17+
build:
1418
runs-on: ubuntu-latest
15-
19+
1620
steps:
1721
- name: Checkout
1822
uses: actions/checkout@v4
19-
23+
2024
- name: Setup Node.js
2125
uses: actions/setup-node@v4
2226
with:
2327
node-version: '20'
2428
cache: 'npm'
25-
29+
2630
- name: Install dependencies
2731
run: npm ci
28-
32+
2933
- name: Build
3034
run: npm run build
31-
32-
- name: Deploy to GitHub Pages
33-
if: github.ref == 'refs/heads/main'
34-
uses: peaceiris/actions-gh-pages@v3
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v4
38+
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
3541
with:
36-
github_token: ${{ secrets.GITHUB_TOKEN }}
37-
publish_dir: ./demo
42+
path: './demo'
43+
44+
deploy:
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
runs-on: ubuntu-latest
49+
needs: build
50+
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)