Skip to content

Commit 2b4a9f0

Browse files
committed
Guide: Deploy to Cloudflare Pages
1 parent 982954c commit 2b4a9f0

3 files changed

Lines changed: 39 additions & 1 deletion

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Deploy to Cloudflare Pages
2+
3+
Here are the steps to deploy a GitHub repository to Cloudflare Pages.
4+
5+
For reference, see [Cloudflare Pages GitHub Action](https://github.com/marketplace/actions/deploy-to-cloudflare-pages).
6+
7+
Replace the placeholder `example` with your project name. (Kebab case: lowercase alphanumeric with dash `-`, no spaces.)
8+
9+
## Repository secrets
10+
11+
From GitHub repo's Settings -> Secrets -> Actions, add new "repository secrets".
12+
13+
- `CLOUDFLARE_ACCOUNT_ID`
14+
- From dash.cloudflare.com, select the domain. In the Overview's right sidebar, scroll down to find **Account ID**.
15+
- `CLOUDFLARE_API_TOKEN`
16+
- From dashboard, select your user's avatar (top right) and go to Profile -> API Tokens -> Create Token. Then to Custom Token -> Get Started.
17+
- Name: `tangible-cloudflare-pages-deploy`
18+
- Under Permissions, select Account, Cloudflare Pages, and Edit.
19+
- Click Continue to Summary, and **Create Token**.
20+
21+
## Pages project
22+
23+
From Cloudflare dashboard, create a Pages project.
24+
25+
- Go to Workers & Pages, click Create Application. Then Pages -> Drag and drop your files.
26+
- Name: `storybook-example`. Then Created Project - no need to Deploy Site, it will be done in the next step.
27+
28+
## Workflow script
29+
30+
Prepare GitHub Actions workflow script.
31+
32+
- Create `.github/workflows/deploy-cloudflare-pages.yml`
33+
- Copy from [tangible-ui](https://github.com/TangibleInc/tangible-ui/blob/main/.github/workflows/deploy-cloudflare-pages.yml) or pipeline, and replace project-specific values:
34+
- projectName: `storybook-example` - Same as Cloudflare Pages project created above

docs/pages/guides/github-pages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Static site on GitHub Pages
1+
# Deploy to GitHub Pages
22

33
- [GitHub Pages documentation](https://docs.github.com/en/pages)
44
- [Configuring a custom domain for your GitHub Pages site](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site)

docs/sidebars.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ const sidebars: SidebarsConfig = {
149149
type: 'doc',
150150
id: 'guides/main-branch',
151151
},
152+
{
153+
type: 'doc',
154+
id: 'guides/cloudflare-pages',
155+
},
152156
{
153157
type: 'doc',
154158
id: 'guides/github-pages',

0 commit comments

Comments
 (0)