Deployment Guide
This guide covers how to deploy your Firefly blog to various platforms.
Local Build
If you use your own web server (e.g., Nginx, Apache, etc.), you can build locally and upload manually:
pnpm buildThe build output is in the dist/ directory. Upload all files from that directory to your server.
Vercel
Vercel is one of the easiest platforms for deploying Astro projects.
Option 1: Via Vercel Dashboard
- Push your project to GitHub / GitLab / Bitbucket
- Log in to Vercel, click Add New … → Project
- Import your repository
- Vercel will auto-detect the Astro framework:
- Application Preset:
Astro - Build Command:
pnpm build - Output Directory:
dist - Install Command:
pnpm install
- Application Preset:
- Set Node.js version: go to Settings → General → Node.js Version, select
22.x - Click Deploy
Option 2: Using vercel.json
Create vercel.json in the project root:
{
"framework": "astro",
"buildCommand": "pnpm build",
"outputDirectory": "dist",
"installCommand": "pnpm install"
}Netlify
Netlify is another popular static site hosting platform.
Option 1: Via Netlify Dashboard
- Push your project to GitHub / GitLab / Bitbucket / Azure DevOps
- Log in to Netlify
- Click Add new project → Import a Git repository
- Connect your repository
- Configure build settings:
- Build command:
pnpm build - Publish directory:
dist
- Build command:
- Set
NODE_VERSIONto22in Environment variables - Click Deploy …
Option 2: Using netlify.toml
Create netlify.toml in the project root:
[build]
command = "pnpm build"
publish = "dist"
[build.environment]
NODE_VERSION = "22"GitHub Pages
Use GitHub Actions to deploy Firefly to GitHub Pages.
Steps
In your GitHub repository: Settings → Pages → Source, select GitHub Actions
Create
.github/workflows/deploy.ymlin the project root:
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4- Set
siteandbaseinastro.config.mjs:
export default defineConfig({
site: "https://<username>.github.io",
base: "/<repo-name>/",
});WARNING
No editing needed for base, if the GitHub Pages set a custom domain or the repo is named <username>.github.io
Cloudflare Workers / Pages
Cloudflare Workers offers free serverless edge computing, and Cloudflare Pages provides static site hosting. Both can deploy Firefly.
The project already includes a wrangler.jsonc configuration file. You only need to update name to your project name and compatibility_date to today's date:
{
"name": "your-project-name", // change to your project name
"compatibility_date": "YYYY-MM-DD", // edit to today
"compatibility_flags": ["nodejs_compat"],
"assets": {
"directory": "./dist"
}
}Deployment Steps
- Push your project to GitHub / GitLab
- Log in to Cloudflare Dashboard
- Enter Compute → Workers & Pages, click Create application → Connect Github / GitLab
- Select your repository
- Configure build settings:
- Build command:
pnpm build - Deploy command:
npx wrangler deploy
- Build command:
- Click Deploy
Multi-platform Deployment
Cloudflare Pages deployment does not require the Astro adapter — it serves static files directly. The project uses process.env.CF_WORKERS environment variable to determine whether to enable the adapter (only for Workers SSR deployment). Pages and other platforms (Vercel, Netlify, etc.) are not affected.
EdgeOne Pages
EdgeOne Pages is a static site hosting service provided by Tencent Cloud's edge computing platform.
Steps
- Push your project to GitHub / GitLab / Gitee / CNB
- Log in to EdgeOne Console
- Go to Service Dashboard → Pages, click Create project
- Select Import Git repository, connect your repository
- Configure build settings:
- Preset framework:
Astro - Build output directory:
dist - Build command:
pnpm build - Install command:
pnpm install
- Preset framework:
- Set
NODE_VERSIONto22in environment variables - Click Start Deployment
TIP
EdgeOne Pages has edge nodes in mainland China, providing fast access for Chinese users.
Alibaba Cloud ESA
Alibaba Cloud ESA (Edge Security Acceleration) offers a Pages static site hosting feature.
Steps
- Log in to Alibaba Cloud ESA Console
- Go to Pages, click Create Project
- Select Import from Git, connect your GitHub / GitLab repository
- Configure build settings:
- Framework preset:
Astro - Build command:
pnpm build - Output directory:
dist
- Framework preset:
- Set
NODE_VERSIONto22in environment variables - Click Start Deployment
TIP
Alibaba Cloud ESA has extensive edge nodes globally, with particularly broad coverage in mainland China, making it ideal for blogs targeting Chinese users.
Custom Domain
Most platforms support custom domain binding. General steps:
- Add a CNAME record at your DNS provider pointing to the platform-assigned domain
- Add the custom domain in the platform dashboard
- Wait for DNS propagation (usually a few minutes to hours)
- Enable HTTPS (most platforms auto-provision SSL certificates)
Deployment Notes
- Most of the above platforms support automatic deployments: every push to the corresponding branch triggers a build and deploy.
- Ensure
siteinastro.config.mjsis set to your actual domain - If deploying to a subpath (e.g.,
https://example.com/blog/), set thebasefield - Node.js version must be set to 22 or higher on all platforms
- After the initial deployment, subsequent code pushes will automatically trigger redeployment
