Back to Blog
Tutorial4 min read2026-05-01

Deploy a Static Site from GitHub to PandaStack in 3 Steps

Push to GitHub and your site deploys automatically. PandaStack's GitHub integration makes static site hosting effortless with zero configuration.

# Deploy a Static Site from GitHub to PandaStack in 3 Steps

Static sites are the simplest deployment scenario: build HTML/CSS/JS files, serve them from a CDN, done. PandaStack's GitHub integration makes this a three-step process with automatic deploys on every push.

What Counts as a Static Site?

  • Plain HTML/CSS/JavaScript
  • Sites built with Vite, Parcel, or Webpack
  • React apps (after npm run build)
  • Vue and Svelte apps (after build)
  • Documentation sites (VitePress, Docusaurus, Hugo, Jekyll)
  • Eleventy, Astro, or any other static site generator

Anything that outputs a directory of files that can be served directly by a web server.

Step 1: Push Your Site to GitHub

If your site is not already on GitHub, initialize a repository:

cd your-site-directory
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/your-username/your-site.git
git push -u origin main

Make sure your build output directory (e.g., dist, build, out, public) is not in .gitignore unless you are using a build step. PandaStack can run the build for you.

Step 2: Connect Your Repository in PandaStack

  1. 1Log in to [dashboard.pandastack.io](https://dashboard.pandastack.io)
  2. 2Click New DeploymentStatic Site
  3. 3Click Connect GitHub and authorize PandaStack
  4. 4Select your repository

Configure build settings:

SettingValue
Build Commandnpm run build (or leave empty for pre-built sites)
Output Directorydist / build / out / public
Node Version20 (if using a build tool)
  1. 1Click Deploy

Your site builds and deploys in 1-3 minutes.

Step 3: Every Push Triggers a New Deploy

That is it. From now on, every push to your main branch (or configured branch) triggers an automatic rebuild and deployment. No additional configuration required.

Add the Deploy Button to Your README

Let others deploy their own copy of your site in one click:

[![Deploy to PandaStack](https://pandastack.io/deploy-button.svg)](https://dashboard.pandastack.io/deploy?repo=your-username/your-site)

Connect a Custom Domain

  1. 1Go to your deployment → DomainsAdd Domain
  2. 2Enter your domain (e.g., mysite.com or docs.mysite.com)
  3. 3Add a CNAME record in your DNS provider pointing to the PandaStack hostname
  4. 4SSL is provisioned automatically (Let's Encrypt)

Preview Branches

You can configure PandaStack to deploy preview URLs for other branches. This is useful for reviewing changes before merging to main.

CLI Deployment

npm install -g @pandastack/cli
panda login
panda deploy --type static --build-cmd "npm run build" --output dist

Environment Variables for Static Sites

Static site environment variables are injected at build time (not runtime). Add them in your deployment settings before triggering a build:

VITE_API_URL=https://api.yourdomain.com
VITE_ANALYTICS_ID=G-XXXXXXXXXX

For React apps (Create React App), prefix variables with REACT_APP_. For Vite, use VITE_.

Full documentation: [docs.pandastack.io](https://docs.pandastack.io).

Ready to deploy?

Start free on PandaStack — no credit card required.

Start free on PandaStack

More in Tutorial

Browse all Tutorial articles →

See also