File tree Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Expand file tree Collapse file tree 1 file changed +23
-7
lines changed Original file line number Diff line number Diff line change 9
9
types : [published]
10
10
workflow_dispatch :
11
11
12
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13
- permissions :
14
- contents : read
15
- pages : write
16
- id-token : write
17
-
18
12
jobs :
19
13
build :
20
14
runs-on : ubuntu-latest
@@ -59,16 +53,38 @@ jobs:
59
53
run : mv README_files docs/build/html
60
54
61
55
# Upload
62
- - name : Upload artifacts
56
+ - name : Upload artifact
63
57
uses : actions/upload-pages-artifact@v3
64
58
with :
65
59
name : github-pages
66
60
path : docs/build/html/
67
61
62
+ post-page-artifact :
63
+ if : ${{ github.event_name == 'pull_request' }}
64
+ needs : build
65
+ runs-on : ubuntu-latest
66
+ permissions :
67
+ contents : read
68
+ pull-requests : write
69
+ steps :
70
+ - name : Checkout
71
+ uses : actions/checkout@v4
72
+
73
+ - name : Post comment preview
74
+ uses : CDCgov/cfa-actions/post-artifact@v1.0.0
75
+ with :
76
+ artifact-name : github-pages
77
+ gh-token : ${{ secrets.GITHUB_TOKEN}}
78
+ message : " Thanks for your contribution, ${{ github.actor }}; your `{ artifact-name }` is ready for download [here]({ artifact-url })."
79
+
68
80
deploy :
69
81
# Deploy to the github-pages environment
70
82
# but not on PRs
71
83
if : ${{ github.event_name != 'pull_request' }}
84
+ permissions :
85
+ pages : write
86
+ id-token : write
87
+
72
88
environment :
73
89
name : github-pages
74
90
url : ${{ steps.deployment.outputs.page_url }}
You can’t perform that action at this time.
0 commit comments