-
Notifications
You must be signed in to change notification settings - Fork 0
Enable PR builds to deploy preview pages #15
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
Enable PR builds to deploy preview pages #15
Conversation
IsmaelMartinez
commented
Nov 23, 2025
- Add pr-preview.yml workflow to deploy PRs to /pr//
- Update svelte.config.js to support BASE_PATH env var
- Remove PR trigger from main deploy.yml
- Add pr-preview.yml workflow to deploy PRs to /pr/<number>/ - Update svelte.config.js to support BASE_PATH env var - Remove PR trigger from main deploy.yml
|
🚀 Preview deployed to https://ismaelmartinez.github.io/model-selector/pr/15/ |
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.
Pull request overview
This PR enables preview deployments for pull requests to separate URLs under /pr/<number>/, allowing reviewers to test changes before merging. The changes separate PR preview builds from main deployments to support different base paths.
- New workflow for deploying PR previews to dedicated paths
- Configuration update to support dynamic base paths
- Removal of PR trigger from main deployment workflow to avoid conflicts
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/pr-preview.yml |
New workflow that builds and deploys PRs to /pr/<number>/ and comments with preview URL |
svelte.config.js |
Adds paths.base configuration to support the BASE_PATH environment variable |
.github/workflows/deploy.yml |
Removes pull_request trigger to prevent duplicate deployments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/pr-preview.yml
Outdated
| - name: Build with PR base path | ||
| run: npm run build | ||
| env: | ||
| BASE_PATH: /model-selector/pr/${{ github.event.pull_request.number }} |
Copilot
AI
Nov 23, 2025
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.
The repository name 'model-selector' is hardcoded in the BASE_PATH. Consider using ${{ github.event.repository.name }} to make this workflow more portable and maintainable across different repositories or repository renames.
| BASE_PATH: /model-selector/pr/${{ github.event.pull_request.number }} | |
| BASE_PATH: /${{ github.event.repository.name }}/pr/${{ github.event.pull_request.number }} |
Co-authored-by: Copilot <[email protected]>
|
🚀 Preview deployed to https://IsmaelMartinez.github.io/model-selector/pr/15/ |
- Switch main deploy to peaceiris/actions-gh-pages - Add keep_files: true to preserve PR previews and main site
|
🚀 Preview deployed to https://IsmaelMartinez.github.io/model-selector/pr/15/ |
- Remove pr-preview.yml (Vercel handles PR previews automatically) - Revert deploy.yml to official GitHub Pages method - Revert svelte.config.js (no BASE_PATH needed)