-
Notifications
You must be signed in to change notification settings - Fork 217
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
Provide example using cloudflare pages #587
Comments
The only limit that does not look good is 500 builds per month. E.g. if we are deploying the dev sites of all packages for every CI run, then that does not seem like a lot. Nevertheless, we can have support for it, 500 is plenty for a lot of people. |
I'm pretty sure that limit is if you use their CI system to build the site. That used to be a requirement, but just a couple months ago they added the ability to upload static files directly. https://blog.cloudflare.com/cloudflare-pages-direct-uploads/ What I'm doing is building the site using GitHub Actions, then deploying it as a set of static files to Cloudflare Pages. https://developers.cloudflare.com/pages/framework-guides/deploy-anything/ This is what I use in my GHA workflow (after building the site): - name: Publish to Cloudflare Pages
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages publish _site/ --project-name=my_project --commit-dirty=true The pricing is good. Free for unlimited traffic. https://www.cloudflare.com/plans/developer-platform/#overview (Follow the link, then click on "Cloudflare Pages" on the left) |
Now that I think about it a bit more, I'm unsure whether the direct upload counts as a build. Probably a good idea to ask them at https://community.cloudflare.com/ |
@gaborcsardi yeah, I don't think we'd plan to use it for package sites (since GitHub pages already does seem), but having deploy previews is useful for books, and it avoids the potentially large cost overruns that we have with netlify. For that usage, I think 500 builds/deploys a month is likely to be plenty. |
So, it turns out that the example for this is exactly the same as the example for GH Pages. Once you connect CF Pages to a GH repo, their app is watching that repo, and it will automatically pick up the branch and directory you selected. E.g. https://actions-61h.pages.dev/ is deployed from the regular pkgdown workflow: https://github.com/r-lib/actions/blob/v2-branch/examples/pkgdown.yaml I'll document this in the README of the examples. |
And yes, it seems that deploying a static site is also a build, even though the build command is They do have a preview system. I haven't tried, but I imagine that they'll build PRs against that target branch, so you'll get previews automatically. |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue and include a link to this issue |
It's similar to netlify (including deploy previews), but has unlimited bandwidth and build-in analytics. @wch has been experimenting with it so can provide more details.
The text was updated successfully, but these errors were encountered: