From e3d6b940077490a00ff6f1cebae160e5257494ae Mon Sep 17 00:00:00 2001 From: Lukas Wallrich Date: Mon, 27 May 2024 14:07:03 +0100 Subject: [PATCH] Combine Actions further --- ...{R-cmd-check.yaml => R-cmd-check.yaml_OLD} | 0 .github/workflows/ci.yaml | 31 ++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) rename .github/workflows/{R-cmd-check.yaml => R-cmd-check.yaml_OLD} (100%) diff --git a/.github/workflows/R-cmd-check.yaml b/.github/workflows/R-cmd-check.yaml_OLD similarity index 100% rename from .github/workflows/R-cmd-check.yaml rename to .github/workflows/R-cmd-check.yaml_OLD diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3516127..694b8ff 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -35,12 +35,40 @@ jobs: - 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 "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 run: | R -e " install.packages('rsconnect'); 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')" + rsconnect::deployApp(appName = 'CiteSource_latest', appDir = './inst/shiny-app/CiteSource', forceUpdate = TRUE)" + + - name: Deploy release version conditionally + if: github.event_name == 'release' && github.event.release.tag_name != '*test*' + run: | + R -e " + install.packages('rsconnect'); + 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 run: | @@ -56,3 +84,4 @@ jobs: branch: gh-pages folder: docs + - uses: r-lib/actions/check-r-package@v2