Requirements
-
Shifter Headless site
-
GitHub or GitLab repository
-
Cloudflare account
-
Astro
Create Shifter Headless Site
Please have a look at the support document: Getting Started with Shifter Headless.
Set up Git repository
Create a Git repository on GitHub or GitLab
-
https://github.com
-
https://gitlab.com/users/sign_in
Set up Astro
Please refer to Astro’s official documents or other resources:
Set up Cloudflare pages
1. Login to the Cloudflare dashboard
https://www.cloudflare.com/
Navigate to [Workers & Pages] then click [Create application]
![](/wp-content/uploads/2024/03/760895785-63387a609c9891044e02fe16.png)
2. Choose [Pages] and click [Connect to Git]
![](/wp-content/uploads/2024/03/760919466-5b6f0a4d841a523fc9f269c2.png)
3. Select the Git repository
Connect GitHub or GitLab then choose the repository.
![](/wp-content/uploads/2024/03/760919708-0c7abd7b13d87b829502e204.png)
4. Set up builds and deployments.
![](/wp-content/uploads/2024/03/760922327-50de292b0189aa5a019fa0df.png)
Environment variables
You can change the default version of node.js on the Cloudflare Pages by adding “Environment variables”
Astro requires Node.js version 16.12.0, so you’ll need to add the following:
Variable name: NODE_VERSION
Value: 20.2
5. Click [Save and Deploy] to continue.
6. Cloudflare fetches the content and deploys it to the public
![](/wp-content/uploads/2024/03/760922715-7ef0cf101f677efc98432f46.png)
That’s all!
![](/wp-content/uploads/2024/03/760923109-6cd3c69638d1727dcd869a32.png)