Skip to content

Commit

Permalink
Post Artifact as Comment (#61)
Browse files Browse the repository at this point in the history
* [58] implement

* [gha] fix artifact name

* [gha] give sphinx action permissions

* [gha] segregate into distinct jobs

* Update sphinx.yaml

---------

Co-authored-by: George G. Vega Yon <[email protected]>
  • Loading branch information
IsaccBarker and gvegayon authored Nov 22, 2024
1 parent f4cb110 commit 07541fc
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/sphinx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ on:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
actions: read
pull-requests: write

jobs:
build:
Expand Down Expand Up @@ -59,12 +58,30 @@ 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-page-artifact:
if: ${{ github.event_name == 'pull_request' }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Post comment preview
uses: CDCgov/cfa-actions/[email protected]
with:
artifact-name: github-pages
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
Expand Down

0 comments on commit 07541fc

Please sign in to comment.