Skip to content

Commit 1274106

Browse files
committed
feat: changed mechanism to deploy github pages
1 parent 41528a5 commit 1274106

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
918
jobs:
1019
build:
1120
runs-on: ubuntu-latest
@@ -23,11 +32,20 @@ jobs:
2332
run: pnpm build
2433
env:
2534
CI: true
26-
- name: Release to GH pages if on main
27-
if: ${{github.ref == 'refs/heads/main'}}
28-
uses: crazy-max/ghaction-github-pages@v1
35+
- name: Upload Pages artifact
36+
if: github.ref == 'refs/heads/main'
37+
uses: actions/upload-pages-artifact@v3
2938
with:
30-
target_branch: gh-pages
31-
build_dir: dist
32-
env:
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
path: dist
40+
41+
deploy:
42+
if: github.ref == 'refs/heads/main'
43+
needs: build
44+
runs-on: ubuntu-latest
45+
environment:
46+
name: github-pages
47+
url: ${{ steps.deployment.outputs.page_url }}
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)