Skip to content

Commit 6d8426c

Browse files
authored
Merge pull request #14 from ntnn/switch-pages-from-branch
2 parents 4f06556 + 53ef624 commit 6d8426c

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

.github/workflows/pages.yaml

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ on:
1010
workflow_dispatch:
1111

1212
permissions:
13-
contents: read
13+
contents: write # to write the built page to the branch
1414

1515
concurrency:
1616
group: pages
1717
cancel-in-progress: false
1818

1919
jobs:
20+
2021
build:
2122
runs-on: ubuntu-latest
2223
steps:
@@ -27,24 +28,13 @@ jobs:
2728
with:
2829
node-version: 22
2930
cache: npm
31+
3032
- uses: actions/configure-pages@v4
33+
3134
- run: npm ci
3235
- run: npm run build
33-
- uses: actions/upload-pages-artifact@v3
36+
37+
- uses: rossjrw/pr-preview-action@v1
38+
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
3439
with:
35-
path: .vitepress/dist
36-
37-
deploy:
38-
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
39-
permissions:
40-
pages: write
41-
id-token: write
42-
environment:
43-
name: github-pages
44-
url: ${{ steps.deployment.outputs.page_url }}
45-
needs: build
46-
runs-on: ubuntu-latest
47-
name: deploy
48-
steps:
49-
- id: deployment
50-
uses: actions/deploy-pages@v4
40+
source-dir: .vitepress/dist

0 commit comments

Comments
 (0)