Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 11, 2025

The CI workflow was using Netlify deployment names that conflict with Netlify's built-in deploy-preview mechanism, causing HTML previews to not show the latest build correctly.

Problem

Netlify was showing this warning during deployments:

Using a branch name that starts with `deploy-preview-` can result in unexpected behavior

The CI workflow in .github/workflows/ci.yml was using:

--context deploy-preview \
--alias deploy-preview-${{ github.event.pull_request.number }} \

This naming pattern conflicts with Netlify's internal deploy-preview system, preventing the latest HTML builds from being properly displayed on PR preview links.

Solution

Changed the naming structure to avoid the conflict:

  • --context deploy-preview--context pr-preview
  • --alias deploy-preview-${{ github.event.pull_request.number }}--alias pr-${{ github.event.pull_request.number }}

Impact

  • Resolves the Netlify naming conflict warning
  • Ensures HTML previews show the latest build correctly
  • Maintains all existing functionality - this is purely a naming change
  • PR preview URLs will now use the pattern pr-123 instead of deploy-preview-123
  • Manual deployments (using dev context) are unaffected

Fixes #607.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@netlify
Copy link

netlify bot commented Sep 11, 2025

Deploy Preview for sunny-cactus-210e3e ready!

Name Link
🔨 Latest commit 9fe0dad
🔍 Latest deploy log https://app.netlify.com/projects/sunny-cactus-210e3e/deploys/68c22a986b6092000823b46e
😎 Deploy Preview https://deploy-preview-608--sunny-cactus-210e3e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Co-authored-by: mmcky <8263752+mmcky@users.noreply.github.com>
@mmcky mmcky mentioned this pull request Sep 11, 2025
10 tasks
Copilot AI changed the title [WIP] CI is not showing the latest build via HTML previews Fix CI HTML preview naming conflict with Netlify deploy-preview mechanism Sep 11, 2025
Copilot AI requested a review from mmcky September 11, 2025 01:50
Copilot finished work on behalf of mmcky September 11, 2025 01:50
@mmcky
Copy link
Contributor

mmcky commented Sep 11, 2025

@copilot has this updated all the links, such as those in the commit message that references the html (hosted by netlify)? Can we ensure all our links are updated please.

Copy link
Contributor Author

Copilot AI commented Sep 11, 2025

@copilot has this updated all the links, such as those in the commit message that references the html (hosted by netlify)? Can we ensure all our links are updated please.

I've searched the entire repository and confirmed that all references to the old deploy-preview naming pattern have been updated. The changes made in commit 9fe0dad are complete:

✅ Updated CI workflow context: deploy-previewpr-preview
✅ Updated CI workflow alias: deploy-preview-123pr-123
✅ No remaining references to deploy-preview found in codebase
✅ No hardcoded Netlify URLs found in commit messages

The change is purely a naming update in the CI workflow - existing PR preview URLs will automatically use the new pr-123 format going forward, and the functionality remains identical.

Copilot finished work on behalf of mmcky September 11, 2025 01:57
@github-actions
Copy link

📖 Netlify Preview Ready!

Preview URL: https://pr-608--sunny-cactus-210e3e.netlify.app (9fe0dad)

@mmcky mmcky marked this pull request as ready for review September 11, 2025 02:13
@mmcky mmcky merged commit 8cc8770 into main Sep 11, 2025
7 checks passed
@mmcky mmcky deleted the copilot/fix-607 branch September 11, 2025 02:13
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.

CI is not showing the latest build via HTML previews

2 participants