-
Notifications
You must be signed in to change notification settings - Fork 101
feat: add branch-specific PR preview environments #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sudip-mondal-2002
merged 5 commits into
sudip-mondal-2002:main
from
ionfwsrijan:feature/pr-preview-pages
May 16, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
115e347
Add branch-specific PR preview workflow
ionfwsrijan fe856b1
Address preview workflow review feedback
ionfwsrijan c5fd276
Reuse CI web build for PR previews
ionfwsrijan 42f72aa
Harden CI dependency setup for previews
ionfwsrijan 2292998
Merge branch 'main' into feature/pr-preview-pages
sudip-mondal-2002 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,27 @@ This document explains the CI/CD pipeline and how to create releases. | |
| 4. Uploads installers to the release | ||
| 5. Deploys web demo and download page to GitHub Pages | ||
|
|
||
| ### 3. PR Preview Workflow (`.github/workflows/deploy-preview.yml`) | ||
|
|
||
| **Triggers**: Completed CI runs for Pull Requests to `main` or `develop`, and closed Pull Requests | ||
|
|
||
| **What they do**: | ||
| 1. Reuse the `web-build` artifact from the existing CI workflow | ||
| 2. Stage only the static preview files (`index.html`, JavaScript, WebAssembly, data, worker, and service worker files) | ||
| 3. Deploy the preview to GitHub Pages under `pr-previews/pr-<number>/` | ||
| 4. Post or update a PR comment with the live preview URL | ||
| 5. Remove the preview directory automatically when the PR is closed | ||
|
|
||
| Preview URLs follow this format: | ||
|
|
||
| ```text | ||
| https://amplitron.sudipmondal.co.in/pr-previews/pr-<number>/ | ||
| ``` | ||
|
|
||
|
Comment on lines
+54
to
+58
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
| The preview deployment intentionally reuses the existing CI web build instead of compiling the Emscripten target a second time. Pull Request code is built with read-only CI permissions, while the deploy workflow only publishes the trusted CI artifact to GitHub Pages. | ||
|
|
||
| Because GitHub only runs `workflow_run` workflows that already exist on the default branch, this preview workflow starts creating URLs after it is merged to `main`. The pull request that introduces the workflow cannot publish its own preview from the new workflow file. | ||
|
|
||
| ## Creating a Release | ||
|
|
||
| ### Step 1: Prepare the Release | ||
|
|
@@ -97,7 +118,7 @@ To trigger a release manually, push to `main` and let CI complete. The release w | |
| 3. Branch: `gh-pages` / `root` | ||
| 4. Click Save | ||
|
|
||
| The website will be available at: https://sudip-mondal-2002.github.io/Amplitron/ | ||
| The website will be available at: https://amplitron.sudipmondal.co.in/ | ||
|
|
||
| ### Update the Download Page | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: sudip-mondal-2002/Amplitron
Length of output: 7092
Fix bare
waitto properly fail when any background download job failsIn Lines 42-51, 89-98, 235-245, 346-355, 427-437, and 493-503, background downloads are followed by bare
wait, which can return 0 even when one job fails. This allows failed downloads to go undetected. Capture PIDs and wait on each one individually:Suggested fix
🤖 Prompt for AI Agents