Step 1: Get Token
Generate the firebase token from your terminal using the command $ firebase login:ci
Waiting for authentication...
✔ Success! Use this token to login on a CI server:
1/VXXXXXXX--YOUR-FIREBASE-CI-TOKEN--XXXXXh92o
Example: firebase deploy --token "$FIREBASE_TOKEN"
Step 2: Setup Variable
GitLab Repo -> Settings -> CI/CD -> Secret Variables -> Add the below
Key: FIREBASE_TOKEN
Value: 1/VXXXXXXX--YOUR-FIREBASE-CI-TOKEN--XXXXXh92o
Note:
- Replace the
<project-name>
with your firebase project name - Entire
cache:
block andyarn
,yarn run build
scripts (Line no: 6-9, 16-17) are not needed for non node projects like simple webpages having no package.json
Step 1: Get Token
Go to Account Settings from your account and Reveal the API Key
-or-
Get the heroku auth token from your terminal using the command $ heroku auth:token
79xxYOUR-HERO-KUxx-AUTH-TOKENxxxxx62
Step 2: Setup Variable
GitLab Repo -> Settings -> CI/CD -> Secret Variables -> Add the below
Key: HEROKU_TOKEN
Value: 79xxYOUR-HERO-KUxx-AUTH-TOKENxxxxx62
Note: Heroku deployment will occur only if pushed to heroku's master branch (Line no: 10).
- For master branch deployments,
git push heroku master
can be used as usual - For non-master branch deployments, the current branch / HEAD is pushed with different remote-tracking branch name as 'master'
git push heroku HEAD:master
- The flag
-f
force push is needed if 'force push' is allowed in your code repository