update Kevin's link #156
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: CI/CD | |
| on: | |
| pull_request: | |
| branches: [devel] | |
| push: | |
| branches: | |
| - devel | |
| schedule: | |
| - cron: '0 1 * * 0' # every Sunday at 01:00 UTC | |
| env: | |
| cache-version: v1 | |
| jobs: | |
| # Build job for pull requests | |
| build: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev | |
| - name: Cache R packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.R | |
| key: ${{ env.cache-version }}-${{ runner.os }}-${{ hashFiles('DESCRIPTION') }} | |
| restore-keys: | | |
| ${{ env.cache-version }}-${{ runner.os }}- | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install R dependencies | |
| run: Rscript -e 'install.packages("remotes"); remotes::install_deps(dependencies = TRUE)' | |
| - name: Render Quarto Project | |
| run: quarto render | |
| # Deploy job for pushes to devel and scheduled builds | |
| deploy: | |
| if: github.ref == 'refs/heads/devel' && (github.event_name == 'push' || github.event_name == 'schedule') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudunits2-dev libgdal-dev libgeos-dev libproj-dev | |
| - name: Cache R packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.R | |
| key: ${{ env.cache-version }}-${{ runner.os }}-${{ hashFiles('DESCRIPTION') }} | |
| restore-keys: | | |
| ${{ env.cache-version }}-${{ runner.os }}- | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install R dependencies | |
| run: Rscript -e 'install.packages("remotes"); remotes::install_deps(dependencies = TRUE)' | |
| - name: Add CNAME for custom domain | |
| run: echo "training.bioconductor.org" > CNAME | |
| - name: Publish to GitHub Pages (and render) | |
| uses: quarto-dev/quarto-actions/publish@v2 | |
| with: | |
| target: gh-pages | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |