P
PaperHouseastro theme ~
Get started

Deploy

Push PaperHouse to GitHub and deploy to Cloudflare Pages, Netlify, Vercel, and any static host. A complete step-by-step guide.

Deploy

This guide walks you through pushing PaperHouse to GitHub and deploying it to the four most popular static hosts.

By the end, your site will be live on the internet with automatic deploys every time you push a change.

Step 1 — Create a GitHub account

Skip this step if you already have one.

  1. Go to github.com/signup
  2. Enter your email, create a password, and pick a username
  3. Verify your email address

GitHub is free for public and private repositories with unlimited collaborators .

Step 2 — Create a GitHub repository

  1. Log in to GitHub
  2. Click the + icon in the top right → New repository
  3. Name it something like paperhouse or my-portfolio
  4. Leave it Public (or Private if you prefer)
  5. Do not check “Add a README file” or “.gitignore” — you already have those
  6. Click Create repository

GitHub will show you a page with setup commands. Copy the repository URL — it looks like:

https://github.com/YOUR_USERNAME/paperhouse.git

Step 3 — Push your local code to GitHub

Open your terminal in the PaperHouse project folder.

Initialize Git (first time only)

git init

Add all files

git add .

Create your first commit

git commit -m "Initial commit"

Connect to GitHub

git remote add origin https://github.com/YOUR_USERNAME/paperhouse.git

Replace YOUR_USERNAME with your actual GitHub username.

Push

git branch -M main
git push -u origin main

If GitHub asks for authentication, use a personal access token — not your password. Create one at github.com/settings/tokens with repo scope .

Refresh your GitHub repository page. Your PaperHouse files should be there.

Step 4 — Choose your host

You can deploy to any of these. All have free tiers.

Host Best for Build command Output
Cloudflare Pages Fastest global CDN npm run build dist
Netlify Easiest setup npm run build dist
Vercel Best DX npm run build dist
GitHub Pages Free, tied to GitHub npm run build dist

Step 5a — Deploy to Cloudflare Pages

  1. Go to dash.cloudflare.com and log in
  2. Go to Workers & Pages
  3. Click Create application → Pages tab
  4. Click Connect to Git
  5. Select your GitHub repository
  6. Configure the build:
    • Production branch: main
    • Build command: npm run build
    • Build output directory: dist
  7. Click Save and Deploy

Cloudflare builds and deploys your site. Every push to main triggers a new build .

Your site is live at https://your-project.pages.dev.

Custom domain

  1. In Cloudflare Pages → your project → Custom domains
  2. Click Set up a custom domain
  3. Enter your domain and follow DNS instructions

Step 5b — Deploy to Netlify

  1. Go to netlify.com and log in
  2. Click Add new site → Import an existing project
  3. Connect GitHub and select your repository
  4. Netlify auto-detects Astro. Confirm:
    • Build command: npm run build
    • Publish directory: dist
  5. Click Deploy site

Every push to your main branch redeploys automatically .

Your site is live at https://random-name.netlify.app. Rename it in Site settings → Site information.

Step 5c — Deploy to Vercel

  1. Go to vercel.com and log in
  2. Click Add New → Project
  3. Import your GitHub repository
  4. Vercel auto-detects Astro. Confirm the settings
  5. Click Deploy

Vercel creates a production deployment and a preview deployment for every pull request .

Your site is live at https://your-project.vercel.app.

Step 5d — Deploy to GitHub Pages

GitHub Pages serves your site from the repository itself. You need a small config change first.

Set the base path

Open astro.config.mjs and add:

export default defineConfig({
  site: 'https://YOUR_USERNAME.github.io',
  base: '/paperhouse',
  // ...
});

Replace YOUR_USERNAME and paperhouse with your actual values.

Add a GitHub Actions workflow

Create .github/workflows/deploy.yml:

name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm ci
      - run: npm run build
      - uses: actions/upload-pages-artifact@v3
        with:
          path: dist

  deploy:
    needs: build
    runs-on: ubuntu-latest
    environment:
      name: github-pages
    steps:
      - uses: actions/deploy-pages@v4

Enable Pages

  1. Go to your repository → Settings → Pages
  2. Under Source, select GitHub Actions
  3. Push the workflow file

Your site is live at https://YOUR_USERNAME.github.io/paperhouse .

Step 6 — Verify your deployment

After deploying to any host:

  1. Open your live URL
  2. Check the home page loads
  3. Navigate to /works, /blog, /contact, /docs
  4. Open DevTools → Console — check for errors
  5. View source (Ctrl + U) — confirm meta tags are present

Step 7 — Set up a custom domain

Every host above supports custom domains. The general steps:

  1. Buy a domain from Namecheap, Cloudflare, or Google Domains
  2. In your host’s dashboard, add the domain
  3. Update DNS records at your registrar:
    • A record → your host’s IP (if provided)
    • CNAME record → www → your host’s subdomain
  4. Wait for DNS propagation (1-48 hours)
  5. Enable HTTPS — most hosts do this automatically

Automatic deploys

Once connected, every host above watches your main branch. Push a change and the site rebuilds:

git add .
git commit -m "Update hero copy"
git push

Your site updates in 1-2 minutes.

Environment variables

If you add secrets (API keys, tokens), set them in your host’s dashboard — never commit them to Git.

  • Cloudflare: Workers & Pages → Settings → Environment variables
  • Netlify: Site settings → Environment variables
  • Vercel: Project settings → Environment Variables
  • GitHub Pages: Repository → Settings → Secrets and variables → Actions

Astro reads them via import.meta.env. Private variables need no prefix. Public ones need PUBLIC_ .

Troubleshooting

“Build failed: Cannot find module.”
Run npm install locally and commit package-lock.json.

“404 on subpages.”
Your base path is wrong. Check astro.config.mjs.

“Styles missing.”
Ensure src/styles/globals.css is imported in src/layouts/Base.astro.

“Site shows old content.”
Hard refresh with Ctrl + Shift + R or clear your CDN cache in the host dashboard.