Skip to content

update description with DOI and renvlock with plogr #68

update description with DOI and renvlock with plogr

update description with DOI and renvlock with plogr #68

name: document-and-deploy
on:
push:
pull_request:
release:
jobs:
document-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Set up R version
uses: r-lib/actions/setup-r@v2
with:
r-version: "oldrel" # As shinyapps.io needs some time to catch up after releases
use-public-rspm: true
- name: Set up R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: devtools, plogr, roxygen2, remotes, rsconnect, pkgdown
- name: Create documentation
run: |
R -e "
file.remove('NAMESPACE');
descr <- readLines('DESCRIPTION');
descr <- stringr::str_replace(descr, '^Date.*$', paste('Date:', Sys.Date()));
writeLines(descr, 'DESCRIPTION');
roxygen2::roxygenise();
try(devtools::build_manual())
"
- name: commit
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add -f man/\* NAMESPACE
git commit -m 'Documentation' || echo "No changes to commit"
git push origin || echo "No changes to commit"
- name: Deploy latest from dev
if: github.ref == 'refs/heads/dev'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_CONFIG_SNAPSHOT_VALIDATE: "false"
run: |
R -e "
remotes::install_github('ESHackathon/CiteSource', force = TRUE);
rsconnect::setAccountInfo(name=${{secrets.SHINY_LUKAS_ACCOUNT}}, token=${{secrets.SHINY_LUKAS_TOKEN}}, secret=${{secrets.SHINY_LUKAS_SECRET}});
rsconnect::deployApp(
appName = 'CiteSource_latest',
appDir = './inst/shiny-app/CiteSource',
forceUpdate = TRUE)"
- name: Deploy stable version from main
if: github.ref == 'refs/heads/main'
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
RENV_CONFIG_SNAPSHOT_VALIDATE: "false"
run: |
R -e "
remotes::install_github('ESHackathon/CiteSource', force = TRUE);
rsconnect::setAccountInfo(name=${{secrets.SHINY_LUKAS_ACCOUNT}}, token=${{secrets.SHINY_LUKAS_TOKEN}}, secret=${{secrets.SHINY_LUKAS_SECRET}});
rsconnect::deployApp(
appName = 'CiteSource',
appDir = './inst/shiny-app/CiteSource',
forceUpdate = TRUE)"
- name: Create pkgdown
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
if (!require(CiteSource)) remotes::install_github('ESHackathon/CiteSource', force = TRUE);
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)"
- name: Deploy to GitHub pages 🚀
if: ${{ github.ref_name }} == 'main'

Check warning on line 85 in .github/workflows/document-and-deploy.yml

View workflow run for this annotation

GitHub Actions / document-and-deploy

Workflow syntax warning

.github/workflows/document-and-deploy.yml (Line: 85, Col: 13): Conditional expression contains literal text outside replacement tokens. This will cause the expression to always evaluate to truthy. Did you mean to put the entire expression inside ${{ }}?
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: true
branch: gh-pages
folder: docs