-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update prod app to use ADKP data model (#20)
* Update ui.R Added EL to name * Update ui.R * Revert "Update ui.R" This reverts commit 361b669. * Revert "Merge pull request #14 from nlee-sage/master" This reverts commit 169e4ab, reversing changes made to c1d59fe. * remove renv artifacts * re-install renv and packages * replace synapse table with data model csv * remove reticulate and synapseclient deps * add data model url to global vars * use data model csv instead of synapse table * adjust reactable column definitions * edit ui instruction display * update reactable output * remove shinyapps.io workflow * add shinylive -> gh pages deployment workflow * update renv lockfile * update rproj settings * ignore shinylive site assets * remove tibble dep * rename workflow to specify shinylive * restore shinyapps.io workflow * fix column display * add workflow dispatch and rename for clarity * force app to update * allow job to run via workflow dispatch trigger * don't run shinylive deploy when PR opened * clarify workflow process * update ui message * bumb checkout version * don't disable renv (didn't work anyway) * update to latest version of workflow from r-lib * don't install from renv during gh action * don't install from renv during action * definitely need renv * ignore large directories during rsconnect deploy * rsconnect ignore Rprofile * rename rsconnect ignore file * this wasn't the right file name * setting appFiles to all files overrides .rscignore * Update README.md * Update README.md --------- Co-authored-by: Nicholas Lee <[email protected]> Co-authored-by: j-hendrickson-sage <[email protected]>
- Loading branch information
1 parent
aee0766
commit 506060b
Showing
18 changed files
with
1,851 additions
and
382 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
^\.github$ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
source("renv/activate.R") | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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 | ||
|
||
name: shinyapps-io-deploy | ||
|
||
# run when PR is merged OR via workflow dispatch | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
workflow_dispatch: | ||
|
||
jobs: | ||
shinyapps-io-deploy: | ||
if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
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: Authorize and deploy app | ||
run: | | ||
branch<-Sys.getenv("GITHUB_REF_NAME") | ||
repo<-Sys.getenv("GITHUB_REPOSITORY") | ||
appName<-strsplit(repo, "/")[[1]][2] | ||
if (!startsWith(branch, "prod")) { | ||
appName = paste(appName, "staging", sep="-") | ||
} | ||
rsConnectUser <-"${{ secrets.RSCONNECT_USER }}" | ||
rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}" | ||
rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}" | ||
rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret) | ||
# appDir default is current working directory | ||
rsconnect::deployApp(appName = appName, forceUpdate = TRUE) | ||
# important NOT to run this step as sudo, otherwise env var's will be missing | ||
shell: Rscript {0} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Workflow derived from https://github.com/posit-dev/r-shinylive/tree/actions-v1/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
# | ||
# Basic example of a GitHub Actions workflow that builds a Shiny app and deploys | ||
# it to GitHub Pages. | ||
name: Deploy app to gh-pages | ||
|
||
on: | ||
# Manually trigger the workflow | ||
workflow_dispatch: | ||
# Trigger on push to `main` branch | ||
push: | ||
branches: "main" | ||
|
||
jobs: | ||
shinylive: | ||
uses: posit-dev/r-shinylive/.github/workflows/deploy-app.yaml@actions-v1 | ||
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | ||
permissions: | ||
pages: write # to deploy to Pages | ||
id-token: write # to verify the deployment originates from an appropriate source |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
.DS_Store | ||
.project | ||
.settings/ | ||
site/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
renv/ | ||
.Rprofile | ||
.git/ | ||
.Rproj.user/ | ||
*.Rproj | ||
*.log |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,26 @@ | ||
# AMP-AD Metadata Dictionary | ||
|
||
Hosts the dictionary used for metadata in AMP-AD, which is composed of the | ||
[synapseAnnotations](https://github.com/Sage-Bionetworks/synapseAnnotations/) as | ||
well as some custom values that are used only in metadata files, and not as | ||
annotations. | ||
Hosts the dictionary used for metadata in AMP-AD, which is a ReacTable object that displays the production [ADKP data model](https://github.com/adknowledgeportal/data-models/blob/main/AD.model.csv). | ||
|
||
The dictionary app displays all attributes used as manifest columns, and all valid values for those columns. It does not display manifest attributes (where Parent = 'ManifestTemplate'). | ||
|
||
As of August 2024, this app no longer interacts with Synapse since it is pulling from the ADKP data model used for schematic and DCA. The recitulate and synapsclient dependencies have been removed. | ||
|
||
### To deploy to ShinyApps.io: | ||
|
||
- Enable workflows in the GitHub repository | ||
- Under [secrets](https://github.com/Sage-Bionetworks/amp-ad-metadata-dictionary/settings/secrets/actions) click 'New repository secret' | ||
- Enter secrets for `RSCONNECT_USER`, `RSCONNECT_TOKEN`, and `RSCONNECT_SECRET`, the values for which are saved in Sage's LastPass. | ||
- Push to new branch on Github | ||
- Create pull request with at least one reviewer to master branch | ||
- Upon merge of pull request, the app will deploy to staging. | ||
The shinyapps.io deployment workflow is `deploy-shinyapps-io.yaml`. | ||
- This uses repository secrets to deploy the app to ShinyApps.io via rsconnect: `RSCONNECT_USER`, `RSCONNECT_TOKEN`, and `RSCONNECT_SECRET`. Values for these are saved in Sage's LastPass. | ||
- This workflow runs when a PR is approved and merged into, OR via manual workflow dispatch | ||
- Upon completion of the workflow, the app will deploy to staging. | ||
Check out the app here: https://sagebio.shinyapps.io/amp-ad-metadata-dictionary-staging. | ||
- After verifying correctness, create pull request with at least one reviewer to prod branch | ||
- After verifying correctness on `main`, create pull request with at least one reviewer to `prod` branch | ||
- Upon merge of pull request, the app will deploy to production. | ||
- The app' will become available at https://sagebio.shinyapps.io/amp-ad-metadata-dictionary | ||
- The production app will become available at https://sagebio.shinyapps.io/amp-ad-metadata-dictionary | ||
- This app is embedded as an iframe on the Synapse wiki here: https://www.synapse.org/Synapse:syn25878249 | ||
|
||
### To deploy to Github Pages via shinylive: | ||
|
||
The shinylive deployment workflow is `deploy-shinylive.yaml`. | ||
- This uses the `shinylive` package to build a static site that is run entirely in the browser (https://posit-dev.github.io/r-shinylive/), and deploy that site to Github pages | ||
- This workflow runs on a push to `main` or via workflow dispatch | ||
- ⚠️ right now this site loads very, very slowly. The static site will not replace the shinyapps.io deployment as our user-facing version unless we can figure out how to speed it up. |
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 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
Oops, something went wrong.