# 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 mainMake 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
- 1Log in to [dashboard.pandastack.io](https://dashboard.pandastack.io)
- 2Click New Deployment → Static Site
- 3Click Connect GitHub and authorize PandaStack
- 4Select your repository
Configure build settings:
| Setting | Value |
|---|---|
| Build Command | npm run build (or leave empty for pre-built sites) |
| Output Directory | dist / build / out / public |
| Node Version | 20 (if using a build tool) |
- 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:
[](https://dashboard.pandastack.io/deploy?repo=your-username/your-site)Connect a Custom Domain
- 1Go to your deployment → Domains → Add Domain
- 2Enter your domain (e.g.,
mysite.comordocs.mysite.com) - 3Add a CNAME record in your DNS provider pointing to the PandaStack hostname
- 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 distEnvironment 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-XXXXXXXXXXFor React apps (Create React App), prefix variables with REACT_APP_. For Vite, use VITE_.
Full documentation: [docs.pandastack.io](https://docs.pandastack.io).