Skip to content

Commit 07037fa

Browse files
author
IsaccBarker
committed
2 parents 3ec1841 + 329fe8d commit 07037fa

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/sphinx.yaml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ on:
99
types: [published]
1010
workflow_dispatch:
1111

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-
1812
jobs:
1913
build:
2014
runs-on: ubuntu-latest
@@ -59,16 +53,38 @@ jobs:
5953
run: mv README_files docs/build/html
6054

6155
# Upload
62-
- name: Upload artifacts
56+
- name: Upload artifact
6357
uses: actions/upload-pages-artifact@v3
6458
with:
6559
name: github-pages
6660
path: docs/build/html/
6761

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+
6880
deploy:
6981
# Deploy to the github-pages environment
7082
# but not on PRs
7183
if: ${{ github.event_name != 'pull_request' }}
84+
permissions:
85+
pages: write
86+
id-token: write
87+
7288
environment:
7389
name: github-pages
7490
url: ${{ steps.deployment.outputs.page_url }}

0 commit comments

Comments
 (0)