Use Cases
Static websites work well for any project that produces a folder of HTML, CSS, and JavaScript files at build time:Marketing Sites
Fast, globally distributed pages for your product or company homepage.
Single-Page Applications
React, Vue, Svelte, or any other SPA framework that outputs a
dist or build directory.Documentation Sites
Statically generated docs built with tools like Docusaurus, VitePress, or Hugo.
Landing Pages
Campaign pages, event registrations, and product launches that need zero cold-start time.
Requirements
Before you deploy a static website, make sure you have:- A GitHub repository with a build command that outputs static files to a known directory.
- An AWS account connected to Springwinter. See Connect Your AWS Account.
- A GitHub account connected via the Springwinter GitHub App. See Connect GitHub.
Deploy a Static Website
1
Add the resource
Open your project in the Springwinter dashboard, click Add resource, and select Static website.
2
Select a repository and branch
Choose the GitHub repository to deploy from and the branch to track. Springwinter will build and publish on every push to that branch when auto-deploy is enabled.
3
Set the build command
Enter the command that compiles your site — for example,
npm run build, yarn build, or hugo. Springwinter runs this command inside a clean environment with your repository checked out.4
Set the publish directory
Enter the directory that contains the built output — for example,
dist, build, out, or public. Springwinter uploads the contents of this directory to your S3 bucket.5
Deploy
Click Deploy. Springwinter runs your build command, syncs the output to S3, and invalidates the CloudFront cache. Your site is live at the assigned CloudFront URL as soon as the invalidation completes.
How Builds Work
Every deployment follows the same sequence:- Springwinter checks out the latest commit on the tracked branch.
- Your build command runs in an isolated environment.
- The contents of your publish directory are uploaded to your S3 bucket.
- Springwinter creates a CloudFront cache invalidation so all cached files are purged.
- CloudFront begins serving the new files from the nearest edge location.
The S3 bucket is not publicly accessible on its own. CloudFront is the only entry point, and Springwinter configures an Origin Access Control (OAC) policy to enforce this.
Configuration Options
Build command
Build command
The shell command Springwinter runs to produce your static output — for example,
npm run build or yarn export. The command runs from the repository root.Publish directory
Publish directory
The path, relative to the repository root, where your build command writes its output files. Common values are
dist, build, out, and public.Auto-deploy
Auto-deploy
When enabled, every push to the tracked branch triggers a new build and deploy automatically. Disable auto-deploy if you need manual control over when updates go live.
Environment variables
Environment variables
Injected into the build environment at build time. Use them to pass API endpoints, feature flags, or other values your build tool needs. See Environment Variables.
API Reference
Create a Static Website
Get a Static Website
Update a Static Website
Redeploy
To trigger a manual rebuild and republish without pushing a commit:Branch Previews
Each branch in your repository can have its own preview deployment with its own CloudFront URL, letting you verify changes before merging. Create a preview via the API:Environment Variables
Retrieve the current build-time environment variables for a static website:For static websites, environment variables are injected at build time, not at runtime. Update your environment variables and trigger a redeploy to pick up changes.