Merge pull request #43 from mchlln/fix_typo_and_deps #20
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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libgdal-dev libgeos-dev libproj-dev libudunits2-dev | |
| - name: Install R dependencies | |
| run: | | |
| Rscript -e 'install.packages(c("shiny", "leaflet", "bslib", "arrow", "geosphere", "sf", "dplyr", "pak", "RPostgres", "DBI"))' | |
| Rscript -e 'pak::pkg_install("posit-dev/r-shinylive")' | |
| - name: Export Shinylive app | |
| env: | |
| DB_HOST: ${{ secrets.DB_HOST }} | |
| DB_PORT: ${{ secrets.DB_PORT }} | |
| DB_NAME: ${{ secrets.DB_NAME }} | |
| DB_USER: ${{ secrets.DB_USER }} | |
| DB_PASSWORD: ${{ secrets.DB_PASSWORD }} | |
| run: | | |
| Rscript -e 'shinylive::export(appdir = ".", destdir = "docs")' | |
| touch docs/.nojekyll | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs |