File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,16 @@ permissions:
14
14
contents : read
15
15
pages : write
16
16
id-token : write
17
-
18
- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19
- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
17
+
20
18
concurrency :
21
- group : " pages"
22
- cancel-in-progress : false
19
+ group : " pages-${{ github.event.pull_request.number || github.run_id }} "
20
+ cancel-in-progress : true
23
21
24
22
jobs :
25
23
# Single deploy job since we're just deploying
26
24
deploy :
27
25
environment :
28
- name : github-pages
26
+ name : pr-preview-${{ github.event.pull_request.number || github.run_id }}
29
27
url : ${{ steps.deployment.outputs.page_url }}
30
28
runs-on : ubuntu-latest
31
29
steps :
45
43
- name : Upload artifact
46
44
uses : actions/upload-pages-artifact@v3
47
45
with :
48
- # Upload entire repository
46
+ # Upload just the public folder
49
47
path : ' public'
50
48
- name : Deploy to GitHub Pages
51
49
id : deployment
52
50
uses : actions/deploy-pages@v4
51
+ - name : Comment Preview URL on PR
52
+ if : github.event_name == 'pull_request'
53
+ uses : marocchino/sticky-pull-request-comment@v2
54
+ with :
55
+ token : ${{ secrets.GH_ACCESS_TOKEN }}
56
+ message : |
57
+ 🚀 Preview: ${{ steps.deployment.outputs.page_url }}
You can’t perform that action at this time.
0 commit comments