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

[ github-actions ] : Add workflow to get preview from fork repository and deploy to cf pages #785

Merged
merged 4 commits into from
Jul 29, 2024

Conversation

aialok
Copy link
Member

@aialok aialok commented Jun 26, 2024

What kind of change does this PR introduce?

  • This PR introduces two workflows: one for preview deployment and another for production.
  • We are transitioning from native Cloudflare app deployment to our own manual workflow for both preview and production deployments.
  • Since Cloudflare does not support previews from forked repositories, we are implementing manual deployment via GitHub Actions.

Issue Number:

Screenshots/videos:

If relevant, have you updated the documentation?

Summary

Does this PR introduce a breaking change?

@aialok aialok marked this pull request as ready for review June 29, 2024 09:50
@aialok aialok requested a review from a team as a code owner June 29, 2024 09:50
@aialok aialok changed the title [ github-actions ] : Add workflow to get preview from fork repository [ github-actions ] : Add workflow to get preview from fork repository and deploy to cf pages Jun 29, 2024
Copy link
Contributor

@AdrianGonz97 AdrianGonz97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the consideration of using my action. Everything looks good to me!

All that's left to do is to:

  1. generate an API key and add the Cloudflare credentials as env secrets
  2. remove the existing github integration so that they don't conflict

I also want to reiterate what's said on the README regarding secrets and PR previews from forks:

If private secrets are being used during build time (which doesn't seem to be the case here) or at runtime for preview deployments (I can't tell from a glance, but it's viewable from Workers & Pages > YourSiteName > Settings > Environment Variables), then PR approvals should be added so that each deployment requires approval.

Taking a look at .env.example:

website/.env.example

Lines 1 to 2 in 7241449

NEXT_PUBLIC_ALGOLIA_API_KEY=
NEXT_PUBLIC_ALGOLIA_APP_ID=

it doesn't seem like any private secrets are being used, making preview deployments without pre-approval OK.

.github/workflows/preview-deployment.yml Outdated Show resolved Hide resolved
@aialok
Copy link
Member Author

aialok commented Jun 29, 2024

Thank you @AdrianGonz97 for your time and consideration.

I will be making the requested changes : )

Copy link
Collaborator

@benjagm benjagm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try this! Great job Alok!

@benjagm benjagm merged commit 2882896 into json-schema-org:main Jul 29, 2024
5 of 6 checks passed
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.

Get previews for PRs from forks
3 participants