Skip to content
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

build: add config to render app in pull requests #48

Merged
merged 2 commits into from
Oct 1, 2023

Conversation

davidlj95
Copy link
Owner

@davidlj95 davidlj95 commented Oct 1, 2023

The canonicalUrl in environment config is not the proper one when using Cloudflare Pages previews in pull requests. In order to fix that, a new Angular environment is introduced to contain the canonicalUrl for this case.

Unfortunately, as their docs state, the ID generated for Cloudflare Pages URLs is random.

But it also sets an alias with the branch name, so we can use that to generate the canonical URL for previews.

In order to get the branch name, we use the GITHUB_HEAD_REF environment variable to grab the branch name in CI or call git CLI when running locally this config for dev purposes.

To access that environment variable, the environment file is templated. And template rendering engine sets the branch name.

Also:

  • Add run configuration to run the Prebuild step
  • Add script to prerender the app with pull request config.
  • Add script to to serve locally with pull request config. Add run configuration too.

@davidlj95
Copy link
Owner Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@github-actions
Copy link

🎉 This PR is included in version 2.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant