diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..80919d0 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,46 @@ +on: + pull_request: + types: + - opened + - reopened + - synchronize + - closed # Including closed to remove preview when PR is closed. + branches: + - main + +jobs: + build: + if: github.event.action != 'closed' # If closing the PR, no publishing + runs-on: ubuntu-latest + # To cancel previous actions that could run on this PR + concurrency: + group: preview-${{ github.ref }} + cancel-in-progress: true + steps: + - name: Check out repository + uses: actions/checkout@v5 + with: + fetch-depth: 0 # To enable full access to Git repo + ref: ${{ github.event.pull_request.head.ref }} # Reference of the commit to checkout to. To ensure it's the one of the PR + repository: ${{github.event.pull_request.head.repo.full_name}} # Reference to the branch to checkout to. Useful with PR from forks + + # Quarto + - name: Set up Quarto + uses: quarto-dev/quarto-actions/setup@v2 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # Render Quarto + - name: Render Quarto Project + uses: quarto-dev/quarto-actions/render@v2 + with: + to: html + # env: # For Quarto profiles + # QUARTO_PROFILE: preview + + - name: Deploy preview + id: deploy-preview + uses: rossjrw/pr-preview-action@v1.6.2 + with: + source-dir: ./_site/ + preview-branch: gh-pages diff --git a/index.qmd b/index.qmd index d09d023..8e2ef4b 100644 --- a/index.qmd +++ b/index.qmd @@ -48,4 +48,4 @@ To learn more about Quarto websites visit . -``` \ No newline at end of file +```