Use shinylive to show the app on the README #3320
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Docs 📚 | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "inst/templates/**" | |
- "_pkgdown.*" | |
- DESCRIPTION | |
- "**.md" | |
- "**.Rmd" | |
- "man/**" | |
- "LICENSE.*" | |
- NAMESPACE | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
branches: | |
- main | |
paths: | |
- "inst/templates/**" | |
- "_pkgdown.*" | |
- DESCRIPTION | |
- "**.md" | |
- "**.Rmd" | |
- "man/**" | |
- "LICENSE.*" | |
- NAMESPACE | |
workflow_dispatch: | |
jobs: | |
README: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout repo | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Render Rmarkdown files 🖹 | |
run: | | |
RMD_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} *.Rmd)) | |
Rscript -e 'for (f in commandArgs(TRUE)) if (file.exists(f)) rmarkdown::render(f)' ${RMD_PATH[*]} | |
- name: Commit results ⬆️ | |
run: | | |
git config --local user.name "$GITHUB_ACTOR" | |
git config --local user.email "[email protected]" | |
git commit ${RMD_PATH[*]/.Rmd/.md} -m 'Re-build Rmarkdown files' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" | |
docs: | |
name: Pkgdown Docs 📚 | |
needs: README | |
uses: insightsengineering/r.pkg.template/.github/workflows/pkgdown.yaml@main | |
secrets: | |
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }} | |
with: | |
default-landing-page: latest-tag | |
additional-unit-test-report-directories: unit-test-report-non-cran | |
deps-installation-method: setup-r-dependencies |