Deployment#
Deploy your static documentation site to various hosting providers.
Firebase Hosting#
The template includes Firebase Hosting configuration.
Setup#
-
Install Firebase CLI:
npm install -g firebase-tools -
Login to Firebase:
firebase login -
Initialize (already done in template):
firebase init hosting
Deploy#
Build and deploy in one command:
jaspr build && firebase deploy --only hosting
Or use the script:
dart run scripts/firebase_deploy
Other Providers#
Since the output is static HTML, you can deploy anywhere:
Vercel#
jaspr build
vercel deploy build/jaspr
Netlify#
jaspr build
netlify deploy --dir=build/jaspr --prod
GitHub Pages#
- Build the site
- Copy
build/jaspr/contents to yourgh-pagesbranch - Enable GitHub Pages in repository settings
Environment Variables#
For different environments, update lib/utils/constants.dart:
static const String baseUrl = String.fromEnvironment(
'BASE_URL',
defaultValue: '/',
);
Then build with:
jaspr build --define=BASE_URL=https://your-domain.com