Skip to content

wndsrfr21/test_deploy

Repository files navigation

Overview

You are reading this because you want to host your HTML website on Firebase (for that fast global CDN) and make changes via Github. If your website only requires HTML, you can host your HTML code on Github and have any changes you make to the HTML on Github automatically push through CircleCI to Firebase.

https://nextjs.org/docs/advanced-features/static-html-export

The following tutorial assumes that you have already created accounts at Github, Firebase, and CircleCI

Software Requirements

Install Firebase CLI on your machine

Follow the CLI installation instructions [here]. (https://firebase.google.com/docs/cli#install_the_firebase_cli) For now there is no way to avoid this, but if I figure it out, I will update this blog.

Step 1 - Create Firebase Project

Go through the process of creating a new firebase project and make sure to WRITE DOWN the project name for later.

Create a new firebase project

Create a new firebase project Note the name of the project. It should be the name of the project plus a couple of random digits.

Generate Firebase Token for CircleCI

Run the following command in a terminal window to generate the token necessary for CircleCI to connect to Firebase.

firebase init
firebase login:ci

Step 2 - Clone Website Template

Clone https://github.com/wndsrfr21/templatepage.git into your own github directory

Update /.circleci/config.yml

Change line 11

Change the URL "https://github.com/wndsrfr21/templatepage.git" to your github repository URL that you created above.

Change line 13

change FIREBASE_TOKEN_TEMPLATEPAGE to whatever you want to name the variable that holds the firebase token. I named the variable after the project name so that the variable would be unique to this project.

Change line 19 (optional)

You can change the name of the work flow "deploy_templatepage_website" to anything that you want. Maybe wait to change this later when you've successfully run this tutorial once so that you don't stack up too many changes at once.

Update .firebaserc

Change line 3

Change "templatepage-b9a02" to the project name that was generated by Firebase in the first step.

Step 3 - CircleCI

Link CircleCI to Github Repository

Create Environmental Variable

Create the token that CircleCI needs to log into Firebase.

  • In the left hand nav bar, click on PROJECTS.
  • In the new page, click on the name of your Github repository.
  • In the upper right of new window, click on PROJECT SETTINGS.
  • In the left hand nav bar of the new page, click on ENVIRONMENTAL VARIABLES
  • In the updated main page, click on the blue ADD VARIABLE button

Name your variable firebase_token_<project name> as the same name that you picked when modify the /.circleci/config.yml file above.

Deploy to Firebase

To exit out of the Environmental Variable page, click on the "X" in the upper right.

This will bring you back to the PIPELINES page. The first line should contain the last CircleCI attempt and there should be an ACTIONS column to the far right. Click on the "Rerun Workflow From Start" action. This will have CircleCI restart the process now that you have updated the Firebase token with the necessary information and your page should deploy!

https://stackblitz.com/ https://glitch.com/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published