Minor modifications to get into CRAN #3
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: Render and Deploy Quarto Website | |
on: | |
push: | |
branches: | |
- master # Set your default branch name | |
paths: | |
- '.github/workflows/render-website.yml' | |
- 'DESCRIPTION' | |
- 'inst/NEWS' | |
- 'inst/NEWS.Rd' | |
- 'R/**' | |
- 'vignettes/**' | |
- 'website/**' # Make sure to include the path to your website files | |
- 'Governance.md' # Make sure to include the path to your website files | |
jobs: | |
checkpkg: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: release | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- uses: r-lib/actions/check-r-package@v2 | |
with: | |
upload-snapshots: true | |
deploy: | |
needs: checkpkg | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: release | |
- name: Install Dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
any::rcmdcheck | |
tools | |
any::desc | |
any::rmarkdown | |
any::knitr | |
kingaa/pomp | |
any::devtools | |
any::bib2df | |
any::tidyverse | |
any::bookdown | |
- name: Install package from source | |
run: | | |
R CMD INSTALL --preclean --no-multiarch --with-keep.source . | |
- name: Re-Install to generate HTML files | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mkdir -p library | |
Rscript -e "devtools::install(args=c('--preclean','--html','--library=library'))" | |
rsync --delete -a library/panelPomp/html/ website/html | |
rsync --delete --exclude=aliases.rds --exclude=paths.rds --exclude=panelPomp.rdb --exclude=panelPomp.rdx --exclude=macros -a library/panelPomp/help/ website/help | |
R CMD Rdconv -t html inst/NEWS.Rd -o website/NEWS.html | |
ed -s website/html/00Index.html < website/changes.ed | |
- name: Copy Vignettes and Other Files | |
run: | | |
mkdir -p website/vignettes | |
cp vignettes/getting-started.Rmd website/vignettes/. | |
cp vignettes/articles/package_tutorial/tutorial.pdf website/vignettes/. | |
cp Governance.md website/ | |
# cp -r vignettes website/ | |
Rscript --vanilla website/rmd2qmd.R website/vignettes/getting-started | |
rm website/vignettes/getting-started.Rmd | |
tree website | |
- name: Render and Publish | |
uses: quarto-dev/quarto-actions/publish@v2 | |
with: | |
target: gh-pages | |
path: website | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push to panelPomp-org page | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} | |
with: | |
source-directory: 'website/docs' | |
destination-github-username: 'panelPomp-org' | |
destination-repository-name: 'panelPomp-org.github.io' | |
user-email: jeswheel@umich.edu | |
target-branch: main | |