diff --git a/.github/workflows/Build pkgdown site.yaml b/.github/workflows/Build pkgdown site.yaml new file mode 100644 index 0000000..a37235a --- /dev/null +++ b/.github/workflows/Build pkgdown site.yaml @@ -0,0 +1,48 @@ +name: Build pkgdown site + +on: + pull_request: + branches: + - main + +jobs: + build-site: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up R + uses: r-lib/actions/setup-r@v2 + with: + r-version: '4.2.0' + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y libxml2-dev libssl-dev libcurl4-openssl-dev + + - name: Install R package dependencies + run: | + install.packages('remotes') + remotes::install_deps(dependencies = TRUE) + shell: Rscript {0} + + - name: Install pkgdown + run: install.packages('pkgdown') + shell: Rscript {0} + + - name: Build pkgdown site + run: pkgdown::build_site() + shell: Rscript {0} + + - name: Commit and push changes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add -A + git commit -m 'Build pkgdown site [skip ci]' + git push origin HEAD:${{ github.head_ref }}