diff --git a/.github/workflows/quarto-publish.yml b/.github/workflows/quarto-publish.yml index 866c500..4245419 100644 --- a/.github/workflows/quarto-publish.yml +++ b/.github/workflows/quarto-publish.yml @@ -1,54 +1,51 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +# Simple workflow for deploying static content to GitHub Pages +name: Publish Quarto page to GitHub Pages + on: + # Runs on pushes targeting the default branch push: - branches: [main, master] - pull_request: - branches: [main, master] + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -name: render +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true jobs: - render: + # Single deploy job since we're just deploying + publish-site: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: render-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + container: + image: ghcr.io/dukestatsci/r_gh_actions:latest steps: - - name: Generate Locales used in Package within - run: | - sudo locale-gen it_IT.UTF-8 - sudo locale-gen pl_PL.UTF-8 - sudo locale-gen pt_BR.UTF-8 - sudo locale-gen en_GB.UTF-8 - sudo locale-gen fr_FR - sudo locale-gen en_CA + - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + - uses: r-lib/actions/setup-r-dependencies@v2 - - name: Configure Git user + - name: Build site run: | - git config --global user.name "$GITHUB_ACTOR" - git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" - - - uses: actions/checkout@v3 + quarto render - - uses: quarto-dev/quarto-actions/setup@v2 - - - uses: r-lib/actions/setup-r@v2 + - name: Setup Pages + uses: actions/configure-pages@v3 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - - - name: Render book - run: quarto render - + path: '_book/' + - name: Deploy to GitHub Pages - id: gh-pages-deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - branch: gh-pages - folder: _book - \ No newline at end of file + id: deployment + uses: actions/deploy-pages@v1 \ No newline at end of file