Migrate all apps to shinyapps.io and remove Auth0 #18
This file contains hidden or 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
| name: Deploy Nonprofit Analytics Tools | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install R dependencies | |
| run: | | |
| install.packages(c("shinylive", "shiny", "bslib", "DT", "plotly", "dplyr", "tidyr", "lubridate", "reactable", "sparkline", "shinyjs", "ggplot2", "scales")) | |
| shell: Rscript {0} | |
| - name: Export Shinylive apps | |
| run: | | |
| # Create docs directory | |
| dir.create("docs", showWarnings = FALSE) | |
| # Export donor retention calculator | |
| if(dir.exists("donor-retention-calculator")) { | |
| shinylive::export("donor-retention-calculator", "docs", subdir = "donor-retention-calculator") | |
| } | |
| # Export grant tracker (when ready) | |
| if(dir.exists("grant-deadline-tracker")) { | |
| shinylive::export("grant-deadline-tracker", "docs", subdir = "grant-deadline-tracker") | |
| } | |
| # Export fundraising planner (when ready) | |
| if(dir.exists("fundraising-goal-planner")) { | |
| shinylive::export("fundraising-goal-planner", "docs", subdir = "fundraising-goal-planner") | |
| } | |
| # Export fundraising planner (when ready) | |
| if(dir.exists("board-packet-generator")) { | |
| shinylive::export("board-packet-generator", "docs", subdir = "board-packet-generator") | |
| } | |
| # Copy landing page and assets | |
| if(file.exists("index.html")) { | |
| file.copy("index.html", "docs/index.html") | |
| } | |
| # Copy assets directory | |
| if(dir.exists("assets")) { | |
| file.copy("assets", "docs", recursive = TRUE) | |
| } | |
| # Copy shared www directory to each app for Shinylive | |
| if(dir.exists("www")) { | |
| if(dir.exists("docs/donor-retention-calculator")) { | |
| file.copy("www", "docs/donor-retention-calculator", recursive = TRUE) | |
| } | |
| if(dir.exists("docs/board-packet-generator")) { | |
| file.copy("www", "docs/board-packet-generator", recursive = TRUE) | |
| } | |
| } | |
| # Copy style guide if it exists | |
| if(file.exists("style-guide.html")) { | |
| file.copy("style-guide.html", "docs/style-guide.html") | |
| } | |
| shell: Rscript {0} | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'docs' | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |