Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Merge pull request #58 from kingaa/master #4

Merge pull request #58 from kingaa/master

Merge pull request #58 from kingaa/master #4

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
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 -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 }}