From 339c4ca7ac9f5a72df9bb0a83356c12339383f35 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:10:05 +0000 Subject: [PATCH 1/9] dev branch --- .github/workflows/dev.yml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/dev.yml diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml new file mode 100644 index 0000000..ff3cf16 --- /dev/null +++ b/.github/workflows/dev.yml @@ -0,0 +1,40 @@ +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 + From 85bbfc9e2750a4ba04025c974122d9625d62bfb7 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:12:32 +0000 Subject: [PATCH 2/9] with deploy --- .github/workflows/dev.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index ff3cf16..8bd0136 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -38,3 +38,22 @@ jobs: # env: # For Quarto profiles # QUARTO_PROFILE: preview + deploy-preview: + if: github.event.action != 'closed' # Deploying if PR not closed + runs-on: ubuntu-latest + needs: build # Job build is done beforehand and creates previewUrl + steps: + - name: Check out repository + uses: actions/checkout@v5 + # with: + # 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}} + - name: Deploy preview + id: deploy-preview + uses: rossjrw/pr-preview-action@v1.6.2 + with: + source-dir: ./_site/ + preview-branch: gh-pages + + - name: Comment PR + run: echo "Preview visible at ${{ steps.deploy-preview.outputs.preview-url }}" \ No newline at end of file From 5a672459e389af64bfcc1b89a48092029a820f81 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:14:19 +0000 Subject: [PATCH 3/9] test --- .github/workflows/dev.yml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 8bd0136..7ef182f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -38,16 +38,11 @@ jobs: # env: # For Quarto profiles # QUARTO_PROFILE: preview - deploy-preview: - if: github.event.action != 'closed' # Deploying if PR not closed - runs-on: ubuntu-latest - needs: build # Job build is done beforehand and creates previewUrl - steps: - - name: Check out repository - uses: actions/checkout@v5 - # with: - # 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}} + # - name: Check out repository + # uses: actions/checkout@v5 + # # with: + # # 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}} - name: Deploy preview id: deploy-preview uses: rossjrw/pr-preview-action@v1.6.2 From fcbef43d278e421e654d45c65013c2f49a7125f6 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:20:04 +0000 Subject: [PATCH 4/9] fun --- .github/workflows/dev.yml | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 7ef182f..085b770 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -38,11 +38,7 @@ jobs: # env: # For Quarto profiles # QUARTO_PROFILE: preview - # - name: Check out repository - # uses: actions/checkout@v5 - # # with: - # # 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}} + - name: Deploy preview id: deploy-preview uses: rossjrw/pr-preview-action@v1.6.2 @@ -50,5 +46,37 @@ jobs: source-dir: ./_site/ preview-branch: gh-pages + - name: Fetch comments # To see if a comment has previously been posted + id: fetch-comments + uses: actions/github-script@v6 + with: + script: | + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }); + + // Find the comment with the body containing "✅ Preview site is ready:" + const previewSiteReadyComment = comments.find(comment => comment.body.includes('🚀 View preview at')); + + // Set the output + if (previewSiteReadyComment) { + core.setOutput('commentId', previewSiteReadyComment.id); + } else { + core.setOutput('commentId', ''); + } + + - name: Delete existing comment if exists + if: steps.fetch-comments.outputs.commentId != '' + uses: actions/github-script@v6 + with: + script: | + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fetch-comments.outputs.commentId }}, + }); + - name: Comment PR run: echo "Preview visible at ${{ steps.deploy-preview.outputs.preview-url }}" \ No newline at end of file From d8aa02d8a4fe8c5b222289b888c511cfee0fb060 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:21:53 +0000 Subject: [PATCH 5/9] delete previous message --- .github/workflows/dev.yml | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 085b770..b804c1f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -38,14 +38,13 @@ jobs: # 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 - + - name: Fetch comments # To see if a comment has previously been posted id: fetch-comments uses: actions/github-script@v6 @@ -67,16 +66,16 @@ jobs: core.setOutput('commentId', ''); } - - name: Delete existing comment if exists - if: steps.fetch-comments.outputs.commentId != '' - uses: actions/github-script@v6 - with: - script: | - await github.rest.issues.deleteComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ steps.fetch-comments.outputs.commentId }}, - }); + - name: Delete existing comment if exists + if: steps.fetch-comments.outputs.commentId != '' + uses: actions/github-script@v6 + with: + script: | + await github.rest.issues.deleteComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: ${{ steps.fetch-comments.outputs.commentId }}, + }); - name: Comment PR run: echo "Preview visible at ${{ steps.deploy-preview.outputs.preview-url }}" \ No newline at end of file From c5c381819a815bfdaaa13489eea643d0692c5999 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:24:33 +0000 Subject: [PATCH 6/9] update message --- .github/workflows/dev.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index b804c1f..de276b3 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -66,16 +66,6 @@ jobs: core.setOutput('commentId', ''); } - - name: Delete existing comment if exists - if: steps.fetch-comments.outputs.commentId != '' - uses: actions/github-script@v6 - with: - script: | - await github.rest.issues.deleteComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: ${{ steps.fetch-comments.outputs.commentId }}, - }); - - name: Comment PR + if: steps.fetch-comments.outputs.commentId == '' run: echo "Preview visible at ${{ steps.deploy-preview.outputs.preview-url }}" \ No newline at end of file From 8badf4112c804355b943b763796457c13fa73ee8 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Tue, 21 Oct 2025 16:27:26 +0000 Subject: [PATCH 7/9] no need to filter, already in rossjrw action --- .github/workflows/dev.yml | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index de276b3..80919d0 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -44,28 +44,3 @@ jobs: with: source-dir: ./_site/ preview-branch: gh-pages - - - name: Fetch comments # To see if a comment has previously been posted - id: fetch-comments - uses: actions/github-script@v6 - with: - script: | - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); - - // Find the comment with the body containing "✅ Preview site is ready:" - const previewSiteReadyComment = comments.find(comment => comment.body.includes('🚀 View preview at')); - - // Set the output - if (previewSiteReadyComment) { - core.setOutput('commentId', previewSiteReadyComment.id); - } else { - core.setOutput('commentId', ''); - } - - - name: Comment PR - if: steps.fetch-comments.outputs.commentId == '' - run: echo "Preview visible at ${{ steps.deploy-preview.outputs.preview-url }}" \ No newline at end of file From f1db383a4f80c1308085bb0b372867e3d33c9498 Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Wed, 22 Oct 2025 09:47:19 +0000 Subject: [PATCH 8/9] with links --- index.qmd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.qmd b/index.qmd index 4fd4840..06b0993 100644 --- a/index.qmd +++ b/index.qmd @@ -4,4 +4,7 @@ title: "quarto_test" This is a Quarto website E. -To learn more about Quarto websites visit . +Links : + +- +- From 5e8c106ddaa2447de2892b08cda75ba755b23d7d Mon Sep 17 00:00:00 2001 From: nicolastlm <192305627+ntoulemonde@users.noreply.github.com> Date: Wed, 22 Oct 2025 12:00:19 +0000 Subject: [PATCH 9/9] updated links --- index.qmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.qmd b/index.qmd index 06b0993..2829c83 100644 --- a/index.qmd +++ b/index.qmd @@ -8,3 +8,5 @@ Links : - - +- +