-
Create Firebase account and login into Firebase CLI:
npx firebase login -
Select the Firebase project to deploy to
npx firebase use <projectId> -
Build and deploy with
/config/production.jsonnpm run deployor to deploy with a custom config pass the name of the config file. For example with
/config/custom.jsonBUILD_ENV=custom npm run deployThe URL to your live site is listed in the output.
In the .github/workflows folder, you can find two workflows to help you develop and deploy Hoverboard to Firebase:
pre-merge.yamlBuilds the project, runs the linter and the tests on every Pull Requestdeploy.yamlDeploys the project to Firebase after every merge tomain.
The pre-merge workflow is already configured and will work out of the box, once you fork the hoverboard repo.
To run the deploy on your instance instead, you need to do a small setup:
First, make sure that you're able to deploy locally correctly with the command:
npm run deployIf the deploy is successful, you can then configure Github Actions to do it for you. You need to generate a login token for the CI with the following command:
npx firebase login:ciOnce you obtained the token, you need to store it as a secret called FIREBASE_TOKEN in the settings of your repository. Additionally you need to set your Firebase project-id as a secret called FIREBASE_PROJECT_ID.
More details on this process can be found here: Creating and storing encrypted secrets.
Push this change to main, and Github Actions will deploy your project to Firebase after every commit.
Enjoy