Skip to content

ci: Deploy to Cloudflare using a Github Action#1159

Merged
jderochervlk merged 31 commits intomasterfrom
vlk/cloudflare-workers
Feb 1, 2026
Merged

ci: Deploy to Cloudflare using a Github Action#1159
jderochervlk merged 31 commits intomasterfrom
vlk/cloudflare-workers

Conversation

@jderochervlk
Copy link
Collaborator

@jderochervlk jderochervlk commented Dec 2, 2025

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 .jsx files.

This also changes some of the commands used for builds and development to simplify things. Now you can run yarn dev to 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).

@jderochervlk jderochervlk force-pushed the vlk/cloudflare-workers branch from 7ed801e to 0273917 Compare December 2, 2025 17:09
Copy link
Member

@cometkim cometkim left a 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.

@jderochervlk
Copy link
Collaborator Author

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.

Why would we want to use workers? Wouldn't pages be best for the static content?

@github-actions
Copy link

github-actions bot commented Feb 1, 2026

Cloudflare deployment

Deployement ID: 3842c61e-331d-4bac-86c4-e791e3e5ae26
Deployment Environment: preview

⛅️ wrangler 4.61.1
───────────────────
✨ Compiled Worker successfully
Uploading... (1011/1013)
Uploading... (1012/1013)
Uploading... (1013/1013)
✨ Success! Uploaded 2 files (1011 already uploaded) (1.49 sec)

✨ Uploading _redirects
✨ Uploading Functions bundle
🌎 Deploying...
✨ Deployment complete! Take a peek over at https://3842c61e.rescript-lang.pages.dev
✨ Deployment alias URL: https://head.rescript-lang.pages.dev

@jderochervlk jderochervlk merged commit f5435c3 into master Feb 1, 2026
2 of 3 checks passed
@jderochervlk jderochervlk deleted the vlk/cloudflare-workers branch February 1, 2026 21:15
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.

3 participants