From ca13c42f87bc46b81517698f8cb88c3902aaf228 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 23 Oct 2024 12:03:32 -0600 Subject: [PATCH 1/3] Replacing artifact and setting retention days to 7 --- .github/workflows/pkgdown.yaml | 41 ++++++++++++++-------------------- NEWS.md | 6 +++++ 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 5c532a5c..7d836e7b 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -171,6 +171,8 @@ jobs: uses: actions/upload-pages-artifact@v3 with: path: ./docs/ + name: github-pages + retention-days: 7 deploy: # check builds on PRs but only deploy when main changes @@ -190,31 +192,22 @@ jobs: uses: actions/deploy-pages@v4 post-page-artifact: - # only comment on PRs - if: ${{ github.event_name == 'pull_request' }} - needs: combine runs-on: ubuntu-latest + + # This job depends on the `build` job + needs: combine + + # Required permissions permissions: - contents: read - pull-requests: write - env: - GH_TOKEN: ${{ github.token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Find Comment - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: Your page is ready to preview + contents: read + pull-requests: write - - name: Create or update comment - uses: peter-evans/create-or-update-comment@v4 + steps: + # Post the artifact pulling the id from the `readme` step. + # The msg will refer to the arfitact as 'README file'. + - name: Post the artifact + if: ${{ github.event_name == 'pull_request' }} + uses: CDCgov/cfa-actions/post-artifact@v1.0.0 with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - Thank you for your contribution, @${{ github.triggering_actor }} :rocket:! Your page is ready to preview [here](https://github.com/${{github.repository}}/actions/runs/${{ github.run_id }}/artifacts/${{ needs.build.outputs.page_artifact_id }}) - edit-mode: replace + artifact-name: github-pages + gh-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/NEWS.md b/NEWS.md index 49dcb767..30f09ddd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# wwinference 0.1.0.99 (dev) + +## Internal changes + +- Updated the workflow for posting the pages artifact to PRs (issue [#229](https://github.com/CDCgov/ww-inference-model/issues/229)). + # wwinference 0.1.0 This is the first major release, focused on providing an initial version of the package. From aec21402b06fd6a8ff8cf6374de452e9a98eff1e Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 23 Oct 2024 13:38:23 -0600 Subject: [PATCH 2/3] Update pkgdown.yaml --- .github/workflows/pkgdown.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 7d836e7b..7cfc3343 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -193,6 +193,8 @@ jobs: post-page-artifact: runs-on: ubuntu-latest + + if: ${{ github.event_name == 'pull_request' }} # This job depends on the `build` job needs: combine @@ -206,7 +208,6 @@ jobs: # Post the artifact pulling the id from the `readme` step. # The msg will refer to the arfitact as 'README file'. - name: Post the artifact - if: ${{ github.event_name == 'pull_request' }} uses: CDCgov/cfa-actions/post-artifact@v1.0.0 with: artifact-name: github-pages From c6dc2d55faabed4f6d48613df0021af344e36aa6 Mon Sep 17 00:00:00 2001 From: "George G. Vega Yon" Date: Wed, 23 Oct 2024 13:53:08 -0600 Subject: [PATCH 3/3] Fixing pre-commit --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 7cfc3343..862f3750 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -193,7 +193,7 @@ jobs: post-page-artifact: runs-on: ubuntu-latest - + if: ${{ github.event_name == 'pull_request' }} # This job depends on the `build` job