Skip to content

Commit 8f22752

Browse files
committed
ci
1 parent 09870a6 commit 8f22752

7 files changed

Lines changed: 4949 additions & 7235 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy to Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
deployments: write
14+
name: Deploy to Cloudflare Pages
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v3
21+
with:
22+
version: 8
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 18
28+
cache: 'pnpm'
29+
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
- name: Build site
34+
run: pnpm build
35+
36+
- name: Deploy to Cloudflare Pages
37+
# Make sure to set the correct project-name for your Cloudflare Pages project
38+
run: npx wrangler pages deploy dist --project-name=actorkit-dev
39+
env:
40+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
41+
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,61 @@ This project is built with:
6262

6363
## How can I deploy this project?
6464

65-
Simply open [Lovable](https://lovable.dev/projects/7a09674e-4dd6-4c5e-a577-cd08f955ec2f) and click on Share -> Publish.
65+
This project is configured for deployment to Cloudflare Pages.
66+
67+
### Automatic Deployment with GitHub Actions
68+
69+
A GitHub Actions workflow (`.github/workflows/cloudflare-pages.yml`) is set up to automatically build and deploy the application whenever changes are pushed to the `main` branch.
70+
71+
The workflow performs the following steps:
72+
73+
1. Checks out the code
74+
2. Sets up Node.js and pnpm
75+
3. Installs dependencies
76+
4. Builds the application (`pnpm build`)
77+
5. Deploys the `dist` directory to Cloudflare Pages using `wrangler`
78+
79+
To enable automatic deployments, you need to configure secrets and variables in your GitHub repository settings:
80+
81+
1. Go to `Settings` > `Secrets and variables` > `Actions`.
82+
2. Add a repository secret named `CLOUDFLARE_API_TOKEN` containing your Cloudflare API token with Pages permissions.
83+
3. Add a repository variable named `CLOUDFLARE_ACCOUNT_ID` containing your Cloudflare account ID.
84+
85+
Also, ensure the `--project-name` in the workflow file matches your Cloudflare Pages project name (`actorkit-dev`).
86+
87+
#### Creating a Cloudflare API Token
88+
89+
1. Go to the [Cloudflare dashboard](https://dash.cloudflare.com)
90+
2. Navigate to `My Profile` > `API Tokens`
91+
3. Click "Create Token"
92+
4. Use the "Edit Cloudflare Workers" template or create a custom token with `Account` > `Cloudflare Pages` > `Edit` permission.
93+
5. Set the Account Resources to include your account.
94+
6. Create the token and copy it.
95+
96+
### Manual Deployment
97+
98+
To deploy manually using `wrangler`:
99+
100+
1. Ensure `wrangler` is installed (`pnpm install -D wrangler` or `npm install -D wrangler`).
101+
2. Log in to Cloudflare: `npx wrangler login`
102+
3. Build the application: `pnpm build`
103+
4. Deploy using the script: `pnpm cf:deploy` (Make sure the `--project-name` in `package.json` is set to `actorkit-dev`).
104+
105+
### Setting Up a New Cloudflare Pages Project
106+
107+
If you're setting up a new Cloudflare Pages project:
108+
109+
1. Log in to your Cloudflare dashboard.
110+
2. Go to `Workers & Pages` > `Create application` > `Pages` > `Connect to Git` or `Upload assets`.
111+
3. If connecting to Git:
112+
- Select your repository.
113+
- Choose `Vite` as the framework preset.
114+
- Ensure the `Build command` is `pnpm build` (or `npm run build`).
115+
- Ensure the `Build output directory` is `dist`.
116+
- Set Environment Variables (Production) for `NODE_VERSION` to `18` (or matching your workflow).
117+
4. If uploading assets:
118+
- Build the project locally (`pnpm build`).
119+
- Drag and drop the `dist` folder or use `wrangler` (`pnpm cf:deploy`).
66120

67121
## Can I connect a custom domain to my Lovable project?
68122

bun.lockb

-194 KB
Binary file not shown.

0 commit comments

Comments
 (0)