-
-
Notifications
You must be signed in to change notification settings - Fork 254
ci: Deploy to Cloudflare using a Github Action #1159
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
base: master
Are you sure you want to change the base?
Conversation
7ed801e to
0273917
Compare
cometkim
left a comment
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.
Deploying via actions is good.
It would be helpful to migrate the pages project to a workers project immediately afterward.
The @cloudflare/pages-plugin-vercel-og project provides excellent support for dynamic OG using a combination of Satori and HTMLRewriter. Also, a change to the CDN cache configuration is required to reduce unnecessary function calls.
This PR switches builds over from being configured in the Cloudfront dashboard to a Github action, which means it's now Infrastructure as Code. We can now also use a Github action to manually fire off a build, which is nice. Having this happen on a Github action will give us access to the deployment URL, which will be needed if we want to setup Playwright or Chromatic for automated testing (which would be great!).
This also tested out an example Cloudflare function, which you can see at https://d0b34a60.rescript-lang.pages.dev/echo?foo=bar. This doesn't mean that the app is using SSR, but Cloudflare pages can still have access to functions, which I plan on using to create dynamic open graph images. The function has been removed after testing. I wanted to make sure that Cloudflare could handle
.jsxfiles.This also changes some of the commands used for builds and development to simplify things. Now you can run
yarn devto kick off concurrent builds for ReScript, Vite, and Wrangler (which will be used to develop functions locally).The existing Cloudflare job is expected to fail and will need to be removed alongside of merging in this PR (probably right before).