on: push: branches: - main - rc-** - docs/** pull_request: branches: - main name: pkgdown jobs: pkgdown: runs-on: ubuntu-18.04 env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v2 - uses: r-lib/actions/setup-r@v1 id: install-r with: use-public-rspm: true - uses: r-lib/actions/setup-pandoc@v1 - uses: r-lib/actions/setup-r-dependencies@v1 with: needs: website - name: Build Site shell: Rscript {0} run: | pkgdown::build_site(new_process = FALSE) - name: Set environment variable $GIT_BRANCH_NAME id: git-branch-name uses: EthanSK/git-branch-name-action@v1 - name: Deploy to Netlify if: github.event_name == 'push' id: netlify-deploy uses: nwtgck/actions-netlify@v1.1 with: publish-dir: 'reference' production-branch: main github-token: ${{ secrets.GITHUB_TOKEN }} deploy-message: 'Deploy from GHA: ${{ github.event.head_commit.message }} (${{ github.sha }})' enable-pull-request-comment: false enable-commit-comment: false enable-commit-status: true alias: deploy-preview-${{ env.GIT_BRANCH_NAME }} env: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}