Merge pull request #23 from NorwegianVeterinaryInstitute/trish-modify #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deploy a shiny app to Posit Connect | |
# Worflow derived from https://github.com/r-lib/actions/blob/v2/examples/shiny-deploy.yaml | |
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
# See also: https://solutions.posit.co/operations/deploy-methods/ci-cd/github-actions/ | |
# And: https://github.com/rstudio/actions | |
name: Update Requirements on Deploy Branch | |
on: | |
push: | |
branches: | |
- main # Trigger when pushing to main | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
environment: CI | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- uses: r-lib/actions/setup-renv@v2 | |
- name: Install rsconnect | |
run: install.packages("rsconnect") | |
shell: Rscript {0} | |
- name: Generate rsconnect manifest.json | |
run: rsconnect::writeManifest() | |
shell: Rscript {0} | |
# For use in case a deploy branch is published on Connect | |
# - name: Commit changes and push to deploy branch | |
# run: | | |
# git config --global user.name "github-actions[bot]" | |
# git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
# git add manifest.json | |
# git commit -m "Update manifest.json on new commit from main" || echo "No changes to commit" | |
# git push origin --force HEAD:deploy # Push to deploy branch, using force because of diverging branches | |
- name: Publish to Posit Connect | |
uses: rstudio/actions/connect-publish@main | |
env: | |
CONNECT_ENV_SET_USER_NAME: ${{ vars.CONNECT_ENV_SET_USER_NAME }} | |
with: | |
url: ${{ secrets.CONNECT_SERVER }} | |
api-key: ${{ secrets.CONNECT_API_KEY }} | |
access-type: all | |
dir: | | |
.:/cake-planning | |