diff --git a/.github/workflows/quarto-publish.yml b/.github/workflows/quarto-publish.yml index 741a9c5..40ab659 100644 --- a/.github/workflows/quarto-publish.yml +++ b/.github/workflows/quarto-publish.yml @@ -1,36 +1,50 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Publish Quarto page to GitHub Pages + on: - workflow_dispatch: + # Runs on pushes targeting the default branch push: - branches: main + branches: ["main"] -name: Quarto Publish + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: -# you need these permissions to publish to GitHub pages +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: - contents: write - pages: write + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true jobs: - build-deploy: + # Single deploy job since we're just deploying + publish-site: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - permissions: - contents: write + container: + image: ghcr.io/dukestatsci/r_gh_actions:latest steps: - - name: Check out repository + - name: Checkout uses: actions/checkout@v3 - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-renv@v2 - - - name: Set up Quarto - uses: quarto-dev/quarto-actions/setup@v2 - - - name: Publish to GitHub Pages (and render) - uses: quarto-dev/quarto-actions/publish@v2 + - name: Build site + run: | + quarto render + + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - target: gh-pages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + path: '_book/' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file