Skip to content

Fix deploy conditions #67

Fix deploy conditions

Fix deploy conditions #67

# Run CI for R using https://eddelbuettel.github.io/r-ci/
name: document-and-deploy
on:
push:
pull_request:
release:
env:
_R_CHECK_FORCE_SUGGESTS_: "false"
jobs:
document-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- name: Setup
uses: eddelbuettel/github-actions/r-ci-setup@master
- name: Bootstrap
run: ./run.sh bootstrap
#- name: Dependencies
# run: ./run.sh install_deps
- name: All Dependencies
run: ./run.sh install_all
- name: Create documentation
run: |
R -e "
install.packages(c('rcmdcheck', 'roxygen2', 'devtools'));
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 "[email protected]"
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
if: github.ref == 'refs/heads/dev' (from dev)

Check failure on line 56 in .github/workflows/document-and-deploy.yaml

View workflow run for this annotation

GitHub Actions / document-and-deploy

Invalid workflow file

The workflow is not valid. .github/workflows/document-and-deploy.yaml (Line: 56, Col: 13): Unexpected symbol: '('. Located at position 32 within expression: github.ref == 'refs/heads/dev' (from dev)
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
install.packages(c('rsconnect', 'remotes'));
bspm::disable();
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' || github.ref == 'refs/heads/master'
run: |
R -e "
rsconnect::deployApp(appName = 'CiteSource', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)"
- name: Create pkgdown
run: |
R -e "
install.packages('pkgdown');
pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)"
- name: Deploy to GitHub pages 🚀
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: true
branch: gh-pages
folder: docs