Static Site Hosting on Firebase
Deploy your static sites with Firebase Hosting for fast and secure global delivery.
Firebase Hosting makes it easy to deploy fast and secure static sites globally.
Method 1: Deploy Using Firebase CLI
1. Prepare Your Static Site
- •Click on 'Save & Download' in ThemesForApp builder dashboard to get your site files.
- •Unzip the downloaded file to a folder (e.g., 'dist', 'build', or 'public').
2. Install Firebase CLI
- •Make sure you have Node.js installed.
- •Open your terminal and run: npm install -g firebase-tools
3. Login to Firebase
- •Run: firebase login
- •Follow the browser prompt to authenticate with your Google account.
4. Initialize Your Project
- •Navigate to your static site folder in the terminal.
- •Run: firebase init hosting
- •Select your Firebase project or create a new one.
- •Set the public directory to your output folder (e.g., 'dist', 'build', or 'public').
- •Choose 'No' for configuring as a single-page app unless needed.
5. Deploy to Firebase Hosting
- •Run: firebase deploy
- •After deployment, you'll get a firebaseapp.com URL for your live site.
6. (Optional) Add a Custom Domain
- •In the Firebase Console, go to Hosting > Add custom domain.
- •Follow the instructions to connect your domain.
Method 2: Deploy from GitHub (Continuous Deployment)
1. Push Your Static Site to GitHub
- •Unzip your static site files and push them to a GitHub repository.
2. Set Up Firebase Hosting GitHub Action
- •In the Firebase Console, go to Hosting > GitHub Actions.
- •Connect your GitHub account and select your repository.
- •Follow the prompts to set up the GitHub Action workflow file.
3. Deploy Automatically on Push
- •Every time you push to your main branch, the GitHub Action will build and deploy your site to Firebase Hosting.
- •You can monitor deployment status in the Actions tab on GitHub.
4. Access Your Live Site
- •After deployment, your site will be live at the firebaseapp.com URL.
- •You can add a custom domain from the Firebase Console if desired.