Merge pull request #28 from uace-azmet/update-units-pkg-0.8-2-to-0.8-3 #20
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
# This action was derived from two main sources: | |
# 1) https://solutions.rstudio.com/data-science-admin/deploy/github-actions/ | |
# 2) https://rstudio.github.io/renv/articles/ci.html | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'README.md' #don't re-deploy the app if only the README changes | |
name: deploy-to-connect | |
jobs: | |
deploy-to-connect: | |
runs-on: ubuntu-latest | |
env: | |
APP_NAME: "azmet-qaqc-dashboard" #edit this | |
APP_DIR: "app" | |
ACCESS_TYPE: "logged_in" #options are "all", "logged_in", or "acl" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.2.2 #freezes R version | |
use-public-rspm: true | |
- name: Install System Dependencies | |
run: | | |
sudo apt-get install libudunits2-dev | |
- uses: r-lib/actions/setup-renv@v2 | |
with: | |
cache-version: 3 | |
- name: Install packages required for Posit Connect | |
shell: Rscript {0} | |
run: | | |
if (!requireNamespace("packrat", quietly = TRUE)) install.packages("packrat") | |
if (!requireNamespace("rsconnect", quietly = TRUE)) install.packages("rsconnect") | |
if (!requireNamespace("Cairo", quietly = TRUE)) install.packages("Cairo") | |
- name: Generate manifest.json | |
run: | | |
rsconnect::writeManifest(appDir = "${{ env.APP_DIR }}") | |
shell: Rscript {0} | |
# For more detailed documentation on this step see | |
# https://github.com/rstudio/actions/tree/main/connect-publish | |
- name: Deploy to RStudio Connect | |
uses: rstudio/actions/connect-publish@main | |
env: | |
CONNECT_ENV_SET_SHINY_USECAIRO: true | |
with: | |
url: https://${{ secrets.CONNECT_APIKEY }}@${{ secrets.CONNECT_URL }} | |
access-type: ${{ env.ACCESS_TYPE }} | |
show-logs: true | |
force: true | |
dir: | | |
./${{ env.APP_DIR }}/:${{ env.APP_NAME }} | |
require-vanity-path: true | |