Update deploy_apps.yaml #120
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
## Trigger workflow: | |
# httr::POST( | |
# "https://api.github.com/repos/DivadNojnarg/outstanding-shiny-ui/dispatches", | |
# httr::content_type_json(), | |
# body = list( | |
# event_type = "deploy", | |
# client_payload = list() | |
# ), | |
# encode = "json", | |
# httr::add_headers( | |
# Authorization = paste0("token ", Sys.getenv("GITHUB_PAT")), | |
# Accept = "application/vnd.github.v3+json, application/vnd.github.everest-preview+json" | |
# ) | |
# ) | |
on: | |
push: | |
branches: [main, master, deploy**] | |
repository_dispatch: | |
types: [all, deploy] | |
name: Deploy Apps | |
jobs: | |
deploy: | |
runs-on: ubuntu-20.04 | |
name: "unleash-shiny.shinyapps.io" | |
env: | |
R_KEEP_PKG_SOURCE: yes | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Cancel previous deployments | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: "4.0" | |
use-public-rspm: true | |
# Move .Rprofile so that system dependencies can be installed | |
- name: "Temporarily move .Rprofile" | |
shell: bash | |
run: mv .Rprofile tmp-Rprofile | |
# Installs latest R packages | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
cache-version: 1 | |
extra-packages: | | |
curl | |
- name: "Move .Rprofile back" | |
shell: bash | |
run: mv tmp-Rprofile .Rprofile | |
# Installs specific R packages | |
- uses: r-lib/actions/setup-renv@v2 | |
with: | |
cache-version: 2 | |
- name: Deploy apps | |
env: | |
SHINYAPPS_NAME: "unleash-shiny" | |
SHINYAPPS_TOKEN: ${{ secrets.SHINYAPPS_TOKEN }} | |
SHINYAPPS_SECRET: ${{ secrets.SHINYAPPS_SECRET }} | |
run: > | |
Rscript 'scripts/deploy_on_ci.R' |