Skip to content

Commit 8b0b6c9

Browse files
authored
actions: PR Preview
1 parent 26f2472 commit 8b0b6c9

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/PR.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy PR Preview to Pages
2+
on:
3+
pull_request:
4+
branches: ["main"]
5+
workflow_dispatch:
6+
7+
permissions:
8+
contents: read
9+
pages: write
10+
id-token: write
11+
12+
concurrency:
13+
group: "pages-pr-${{ github.event.pull_request.number || 'manual' }}"
14+
cancel-in-progress: false
15+
16+
jobs:
17+
deploy:
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Checkout PR
24+
uses: actions/checkout@v4
25+
with:
26+
ref: ${{ github.head_ref }}
27+
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v5
30+
31+
- name: Upload artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: '.'
35+
36+
- name: Deploy to GitHub Pages
37+
id: deployment
38+
uses: actions/deploy-pages@v4
39+
with:
40+
branch: pr-${{ github.event.pull_request.number || 'preview' }}

0 commit comments

Comments
 (0)