Skip to content

Closes #157 Create website preview within Pull Request#374

Merged
bms63 merged 3 commits intomainfrom
copilot/create-website-preview-action
Mar 30, 2026
Merged

Closes #157 Create website preview within Pull Request#374
bms63 merged 3 commits intomainfrom
copilot/create-website-preview-action

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 20, 2026

Adds two GitHub Actions workflows that build and publish a live preview site for every PR, matching the pattern used in pharmaverse/examples.

New Workflows

  • pr-preview.yml — Fires on PR open/sync/reopen/ready-for-review targeting main. Renders the Quarto site using the same Docker image and R packages as publish.yml, deploys the output to a gh-pages subdirectory named after the sanitized branch, and posts (or updates) a sticky PR comment with the preview URL.

  • remove-pr-preview.yml — Fires when a PR targeting main is closed. Checks out gh-pages, removes the branch subdirectory, and updates the sticky comment to indicate the preview is gone.

Key Details

  • Branch names are sanitized ([^a-zA-Z0-9._-]-) before use as directory/URL slugs, handling feature/branch-name-style refs safely.
  • Preview URL pattern: https://pharmaverse.github.io/blog/<sanitized-branch>
  • Uses marocchino/sticky-pull-request-comment so the comment is updated in-place on each push, not duplicated.
  • Both workflows require contents: write + pull-requests: write permissions.
  • The PR preview workflow was manually triggered via commit 6e0259c. A repository maintainer must approve the first workflow run at https://github.com/pharmaverse/blog/actions/runs/23356998421 before the preview is published. Subsequent runs will execute automatically on each push.

Thank you for your Pull Request! We have developed this task checklist to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your blog post.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the main branch until you have checked off each task.

  • Place Closes Fix appendix for all #157 into the beginning of your Pull Request Title (Use Edit button in top-right if you need to update), and make sure the corresponding issue is linked in the Development section on the right hand side
  • Ensure your new post folder is of the form "posts/date_with_short_tile" and the blog post file and any other artifacts have informative but succinct names.
  • Run the script from CICD.R line by line to first check the spelling in your post and then to make sure your code is compatible with our code-style. Address any incongruences by following the instructions in the file!
  • Choose (possibly several) tag(s) or categories from the current list: c("Metadata", "SDTM", "ADaM", "TLG", "Shiny", "Python", "Community", "Conferences", "Submissions", "Technical", "DEI") for your blog post. If you cannot find anything that fits your blog post, propose a new tag to the maintainers! Note: if you use a tag not from this list, the "Check Post Tags" CICD pipeline will error. We occasionally tidy up all tags for consistency.
  • Add a short description for your blog post in the description field at the top of the markdown document.
  • Blog post is short, personalized, reproducible and readable
  • Add a disclaimer at the top of your post, if appropriate (example: Disclaimer This blog contains opinions that are of the authors alone and do not necessarily reflect the strategy of their respective organizations.)
  • Address all merge conflicts and resolve appropriately
  • Assign two of us (@aaehmann, @ashley-tarasiewicz, @chrisprice-phuse) as reviewers in the PR.
  • Pat yourself on the back for a job well done! Much love to your accomplishment!
Original prompt

This section details on the original issue you should resolve

<issue_title>Create website preview within Pull Request</issue_title>
<issue_description>## Background

In the admiral repo and pharmaverse example repo a new github action was created that builds a sample website of what is being done in the Pull Request. This is incredibly helpful for reviewing the content of the Pull Request. Since all the blog posts need to be reviewed for content, layout, images, etc having a website built and a small bot presenting the url would be incredibly helpful. These actions are kept in the .github folders

Repo: https://github.com/pharmaverse/examples
Example Pull Request: pharmaverse/examples#148
Repo: https://github.com/pharmaverse/admiralci
Example Pull Request: pharmaverse/admiral#3009

Definition of Done

  • Create a GitHub Action that publishes a dev site of the blog
  • The action should fire when a Pull Request is open and url should be provided in the Pull Request
  • The action/bot should refresh the url every time an update is made within the branch/Pull Request
  • Once the Pull Request is merged to main or closed the dev site url should be removed</issue_description>

Comments on the Issue (you are @copilot in this section)


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Copilot AI changed the title [WIP] Add GitHub Action for website preview in Pull Request Closes #157 Create website preview within Pull Request Mar 20, 2026
Copilot AI requested a review from bms63 March 20, 2026 18:14
@bms63
Copy link
Copy Markdown
Collaborator

bms63 commented Mar 20, 2026

@copilot could you run the action and have a preview of the blog sent into this Pull Request please?

Co-authored-by: bms63 <10111024+bms63@users.noreply.github.com>
Agent-Logs-Url: https://github.com/pharmaverse/blog/sessions/c0bacbfa-791d-4954-8769-0c88f26998c3
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 20, 2026

@copilot could you run the action and have a preview of the blog sent into this Pull Request please?

The PR Preview workflow was triggered by commit 6e0259c, but it's currently in action_required state — GitHub requires a maintainer to approve the first run of this workflow.

You can approve it here: https://github.com/pharmaverse/blog/actions/runs/23356998421

Once approved (and on all subsequent pushes), it will build the Quarto site and post a comment on this PR with the preview URL: https://pharmaverse.github.io/blog/copilot-create-website-preview-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

Preview removed.

This PR has been closed and the preview website has been removed.

@bms63
Copy link
Copy Markdown
Collaborator

bms63 commented Mar 20, 2026

👀 Preview available!

The preview website for this PR is available at: https://pharmaverse.github.io/blog/copilot-create-website-preview-action

The preview is updated every time a new commit is pushed to this PR.

@rossfarrugia, @aaehmann, @ashley-tarasiewicz, @manciniedoardo (retired) inspired by others - we now have a preview of the blog in each Pull Request!! Okay to merge in??

@bms63 bms63 marked this pull request as ready for review March 20, 2026 18:36
@manciniedoardo
Copy link
Copy Markdown
Collaborator

looks great!

@bms63 bms63 merged commit f2ed4df into main Mar 30, 2026
2 of 3 checks passed
@bms63 bms63 deleted the copilot/create-website-preview-action branch March 30, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create website preview within Pull Request Fix appendix for all

3 participants