update github workflow #40
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: Publish Serverless Shiny App | |
| on: | |
| push: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| - name: Install required packages | |
| run: | | |
| Rscript -e 'install.packages(c("pak"))' | |
| Rscript -e 'pak::pak( | |
| "shiny", "shinylive", "DT", "bslib", "broom", "ggplot2", | |
| "base64enc", "shinyjs", "shinyWidgets", "mgcv", "RColorBrewer", | |
| "tidyr", "purrr", "agricolae", "drc", "cowplot", "MASS", | |
| "Matrix", "equatiomatic", "openxlsx", "car", "httr", "jose", | |
| "openssl" | |
| )' | |
| - name: Export serverless app | |
| run: Rscript deploy_serverless_app.R | |
| - name: Upload to GitHub Pages artifact | |
| uses: actions/upload-pages-artifact@v2 | |
| with: | |
| path: ./_site | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v2 |