Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/doc-preview.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
issue_comment:
types: [created]

name: doc-preview.yaml

permissions: read-all

jobs:
preview:
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'COLLABORATOR' || github.event.comment.author_association == 'CONTRIBUTOR' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/preview-docs') }}

runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Get PR number
id: pr
run: |
PR_NUM=$(echo "${{ github.event.issue.number }}")
echo "number=$PR_NUM" >> $GITHUB_OUTPUT

- uses: actions/checkout@v4
with:
ref: refs/pull/${{ steps.pr.outputs.number }}/head

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './docs'
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-github-deployment: false
enable-commit-status: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 1
Loading