Skip to content

Rm typo in action

Rm typo in action #2

name: document-and-deploy
on:
push:
pull_request:
release:
jobs:
document-and-deploy:
# Skip deploy for automated (e.g., documentation) and [no-deploy] commits
if: "!contains(github.event.head_commit.message, '[automated]') && !contains(github.event.head_commit.message, '[no-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, roxygen2, remotes, rsconnect
- 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 "[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 to Shiny
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
remotes::install_local(force = TRUE);
rsconnect::setAccountInfo(name='forrt-replications', token=${{secrets.SHINYAPPS_TOKEN}}, secret=${{secrets.SHINYAPPS_SECRET}});
rsconnect::deployApp(appName = 'fred_annotator', appDir = './inst/fred_annotator', forceUpdate = TRUE)";
rsconnect::deployApp(appName = 'fred_explorer', appDir = './inst/fred_explorer', forceUpdate = TRUE)";
"
- name: Deploy release version conditionally
if: github.event_name == 'release' && github.event.release.tag_name != '*test*'
run: |
R -e "
appDir <- system.file('fred_explorer', package = 'FReD');
rsconnect::deployApp(appName = 'fred_explorer_release', appDir = './inst/fred_explorer', forceUpdate = TRUE);
appDir <- system.file('fred_annotator', package = 'FReD');
rsconnect::deployApp(appName = 'fred_annotator_release', appDir = './inst/fred_annotator', forceUpdate = TRUE);
"
- name: Create pkgdown
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
R -e "
if (!require(FReD) remotes::install_local(force = TRUE);
options(pkgdown.internet = TRUE)
pkgdown::build_site_github_pages(new_process = FALSE)
"
- name: Deploy to GitHub pages 🚀
if: ${{ github.ref_name }} == 'main'
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: true
branch: gh-pages
folder: docs