From bafe0caa1a8c91d31d977bbdc1802b3a9d8da558 Mon Sep 17 00:00:00 2001 From: Maria Doyle Date: Mon, 23 Sep 2024 22:18:07 +0100 Subject: [PATCH] update action --- .github/workflows/quarto-publish.yml | 32 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/quarto-publish.yml b/.github/workflows/quarto-publish.yml index 54dc59a..8591143 100644 --- a/.github/workflows/quarto-publish.yml +++ b/.github/workflows/quarto-publish.yml @@ -12,6 +12,7 @@ env: jobs: # Job to build and check PRs build: + if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Check out repository @@ -26,11 +27,20 @@ jobs: sudo apt-get update sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev - # Add R dependencies + # Set up caching for R packages + - name: Cache R packages + uses: actions/cache@v3 + with: + path: ~/.R + key: ${{ env.cache-version }}-${{ runner.os }}-R + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}-R- + + # Add R environment setup step - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - + # Install R dependencies - name: Install R dependencies run: Rscript -e 'install.packages(c("evaluate", "rmarkdown", "knitr", "readr", "tidyr", "reactable", "maps", "plotly", "ggplot2", "tidygeocoder", "countrycode"))' @@ -42,7 +52,6 @@ jobs: # Job to deploy only when merging to devel deploy: if: github.event_name == 'push' && github.ref == 'refs/heads/devel' - needs: build runs-on: ubuntu-latest permissions: contents: write @@ -58,21 +67,12 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev - - # Set up caching for R packages - - name: Cache R packages - uses: actions/cache@v3 - with: - path: ~/.R - key: ${{ env.cache-version }}-${{ runner.os }}-R - restore-keys: | - ${{ env.cache-version }}-${{ runner.os }}-R- - # Add R dependencies + # Add R environment setup step - uses: r-lib/actions/setup-r@v2 with: use-public-rspm: true - + # Install R dependencies - name: Install R dependencies run: Rscript -e 'install.packages(c("evaluate", "rmarkdown", "knitr", "readr", "tidyr", "reactable", "maps", "plotly", "ggplot2", "tidygeocoder", "countrycode"))' @@ -82,5 +82,5 @@ jobs: uses: quarto-dev/quarto-actions/publish@v2 with: target: gh-pages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}