diff --git a/.github/workflows/sphinx.yaml b/.github/workflows/sphinx.yaml index 6eaf20b..11841ca 100644 --- a/.github/workflows/sphinx.yaml +++ b/.github/workflows/sphinx.yaml @@ -12,6 +12,7 @@ on: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read + pull-requests: write pages: write id-token: write @@ -59,12 +60,21 @@ jobs: run: mv README_files docs/build/html # Upload - - name: Upload artifacts + - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: name: github-pages path: docs/build/html/ + # Post the artifact pulling the id from the `readme` step. + - name: Post the artifact + uses: CDCgov/cfa-actions/post-artifact@main + if: ${{ github.event_name == 'pull_request' }} + with: + artifact-name: readme + gh-token: ${{ secrets.GITHUB_TOKEN }} + message: "Thanks for your contribution, ${{ github.actor }}; your `{ artifact-name }` is ready for download [here]({ artifact-url })." + deploy: # Deploy to the github-pages environment # but not on PRs