Cloudflare pages
How to deploy to Cloudflare pages?
Here is my short journey of discovering Cloudflare pages
It is always a good idea to first start at the documentation. In my case I had to look if Pelican was compatible to deploy with Cloudflare pages.
Here is a list of which frameworks are compatible with Cloudflare pages.
As far as I have seen there are two ways to deploy a static page to Cloudflare. The first way is searching for the Workers & Pages in the left panel and then start the wizard by clicking on the Create application button.
Keep in mind that these values need to be inserted into the matching fields.
| Configuration option | Value |
|---|---|
| Production branch | main |
| Build command | pelican content |
| Build directory | output |
Finishing the wizard and trying to deploy the page it gave some errors that the build command could not be executed.
I searched if others had the same problem and saw that the Build command that it needs is: pelican content -s publishconf.py
Even though the builds completed every time it could not release the pages
After searching and discovering how the UI is of Cloudflare I discovered that at the top right corner is a + sign
If you click on that + sign then a drop-down menu gives you some options to choose from and in that menu there is the option called "Pages"
Following this wizard with the new Build command everything was a breeze
What is importent to note is that in the documentation they say to se the environment variable PYTHON_VERSION to 3.7.
This is also asked in the wizard to set an environment variable
When I did that it gave package conflicts and had to set the value to 3.12
The final step was adding my custom domain to the worker
Go to Workers & Pages > YourApplication > Custom domains