From fd94bebb0619a74b0515b07419226fc4265f7417 Mon Sep 17 00:00:00 2001 From: Dan Snow Date: Tue, 4 Jul 2023 04:44:15 +0000 Subject: [PATCH] Deploy pkgdown to GH pages --- .github/workflows/pkgdown.yaml | 38 +++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 259ebb3..7e634a6 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -3,6 +3,7 @@ on: workflow_dispatch: pull_request: + branches: [main, master] push: branches: [main, master] release: @@ -10,6 +11,15 @@ on: name: pkgdown +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + cancel-in-progress: false + jobs: prepare-ptaxsim: uses: ./.github/workflows/prepare-ptaxsim.yaml @@ -20,7 +30,6 @@ jobs: runs-on: ubuntu-latest # Only restrict concurrency for non-PR jobs concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} PTAXSIM_DB_PATH: ${{ github.workspace }}/ptaxsim.db @@ -57,10 +66,25 @@ jobs: run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) shell: Rscript {0} - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.4.1 + deploy: + needs: pkgdown + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - clean: false - branch: gh-pages - folder: docs + path: 'docs' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 +