|
| 1 | +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples |
| 2 | +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, master] |
| 6 | + pull_request: |
| 7 | + release: |
| 8 | + types: [published] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +name: pkgdown.yaml |
| 12 | + |
| 13 | +permissions: read-all |
| 14 | + |
| 15 | +jobs: |
| 16 | + pkgdown: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + # Only restrict concurrency for non-PR jobs |
| 19 | + concurrency: |
| 20 | + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} |
| 21 | + env: |
| 22 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + permissions: |
| 24 | + contents: write |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v4 |
| 27 | + |
| 28 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 29 | + |
| 30 | + - uses: r-lib/actions/setup-r@v2 |
| 31 | + with: |
| 32 | + use-public-rspm: true |
| 33 | + |
| 34 | + - name: Install system dependencies |
| 35 | + run: | |
| 36 | + sudo apt-get update |
| 37 | + sudo apt-get install -y grass-dev libgdal-dev libudunits2-dev libharfbuzz-dev libfribidi-dev |
| 38 | + |
| 39 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 40 | + with: |
| 41 | + extra-packages: any::pkgdown, local::. |
| 42 | + needs: website |
| 43 | + |
| 44 | + - name: Download test dataset |
| 45 | + run: | |
| 46 | + wget https://grass.osgeo.org/sampledata/north_carolina/nc_basic_spm_grass7.zip -O /tmp/nc_basic_spm_grass7.zip |
| 47 | + unzip /tmp/nc_basic_spm_grass7.zip -d /tmp/grassdb |
| 48 | + rm /tmp/nc_basic_spm_grass7.zip |
| 49 | +
|
| 50 | + - name: Build site |
| 51 | + run: | |
| 52 | + gisBase <- system2("grass", "--config path", stdout = TRUE) |
| 53 | + rgrass::initGRASS(gisBase = gisBase, gisDbase = "/tmp/grassdb", location = "nc_basic_spm_grass7", mapset = "PERMANENT") |
| 54 | + pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE) |
| 55 | + shell: Rscript {0} |
| 56 | + |
| 57 | + - name: Deploy to GitHub pages 🚀 |
| 58 | + if: github.event_name != 'pull_request' |
| 59 | + |
| 60 | + with: |
| 61 | + clean: false |
| 62 | + branch: gh-pages |
| 63 | + folder: docs |
0 commit comments