From 6242ac0041114d0ada1338d89809a66c70531a71 Mon Sep 17 00:00:00 2001 From: eblondel Date: Thu, 5 May 2022 09:54:11 +0200 Subject: [PATCH] automate pkgdown site build --- .Rbuildignore | 4 ++-- .github/.gitignore | 1 + .github/workflows/pkgdown.yaml | 41 ++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.Rbuildignore b/.Rbuildignore index ea26820..3d87a0e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,4 +1,4 @@ ^.*\.Rproj$ ^\.Rproj\.user$ -.github -doc/slides \ No newline at end of file +doc/slides +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..841202c --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,41 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-pandoc@v1 + + - uses: r-lib/actions/setup-r@v1 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v1 + with: + extra-packages: pkgdown + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE, run_dont_run = TRUE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + clean: true + branch: gh-pages + folder: docs \ No newline at end of file