← Documentation
Deployment
Both the main website and admin portal deploy separately to Cloudflare Pages via GitHub Actions. Deploys run automatically when you push changes to main—and only when the relevant project files change (path-based triggers).
Overview
| Project | Cloudflare Pages project | Deploys when these paths change |
|---|---|---|
| Main website | aien-store | main-website/** or its workflow file |
| Admin portal | admin-portal | admin-portal/** or its workflow file |
Push to main, and only the projects you changed will be built and deployed.
GitHub Secrets
The workflows use a GitHub environment called CLOUDFLARE with these secrets:
| Secret | Purpose |
|---|---|
CLOUDFLARE_API_TOKEN | API token with Cloudflare Pages edit permission |
CLOUDFLARE_ACCOUNT_ID | Your Cloudflare account ID (32-character hex, e.g. from the dashboard URL) |
To create an API token:
- Cloudflare dashboard → My Profile → API Tokens
- Create Token → use the “Edit Cloudflare Workers” template or create a custom token
- Ensure Account → Cloudflare Pages → Edit permission is enabled
Account ID: In the dashboard URL (https://dash.cloudflare.com/<ACCOUNT_ID>/...) or under Workers & Pages → Account details.
Cloudflare Pages Projects
Both projects must exist in Cloudflare before the first deploy:
- Cloudflare dashboard → Workers & Pages → Create application → Pages
- Choose Upload your static files
- Create project
aien-storefor the main website - Create project
admin-portalfor the admin portal
You can upload a dummy file or leave them empty; GitHub Actions will upload the built dist folder on each deploy.
Deployment Flow
- Push changes to
main - GitHub Actions runs only if the relevant paths changed (see table above)
- Job installs dependencies (
npm ci), builds (npm run build), then runswrangler pages deploy dist - Cloudflare Pages serves the new build
View runs and logs under the repository Actions tab.
Manual Deployment (Optional)
If you need to deploy from your machine:
Main website:
cd main-website
npm run build
npx wrangler@3 pages deploy dist --project-name=aien-store
Admin portal:
cd admin-portal
npm run build
npx wrangler@3 pages deploy dist --project-name=admin-portal
Log in first: npx wrangler login, or set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID in your environment.
Note: Use
wrangler@3locally if you see@cloudflare/workerd-darwin-arm64errors with newer Wrangler versions on Apple Silicon.
Summary
- Path-based deploys: only changed projects run
- Uses GitHub environment
CLOUDFLAREand its secrets - Cloudflare Pages projects:
aien-store,admin-portal - Deploys run on push to
mainautomatically