[2022] Auto Firebase deployment and sending Slack notification from Github Actions

KASATA
Geek Culture
Published in
5 min readOct 20, 2022

--

<Introduction>

If you have multiple people developing with Firebase hosting, you may be thinking

  • “I pushed to github but forgot to firebase deploy…”
  • “I did firebase deploy but forgot to push to github…”
  • “Is the uploaded production version uploaded to the production environment matches the latest version on github??”

and so on, confusion and accidents can occur.

One solution to prevent such a situation is to create an environment where the latest version of the main branch in github matches the version of the firebase deployed page.

This section describes how to use GitHub Actions to automatically fire the Firebase Hosting deploy command when it is pushed to the main branch.

In addition, it would be useful to set up a Slack notification to be sent when a firebase deploy from Github Actions is performed correctly, so I will share how to do that as well.

<Get a FIREBASE TOKEN>

Exec this command and firebase token is displayed.

firebase login:ci 

Copy it.

<Set the copied firebase token>

Go to Settings on your Github repo and click Secrets > Actions.

click New repository secret

Enter a name of secrets. FIREBASE_TOKEN this time. (the name is optional)

Paste the copied firebase token.

--

--

KASATA
Geek Culture

Master of Applied Physics/Programmer/Optics/Condensed Matter Physics/Quantum Mechanics/AI/IoT/Python/C,C++/Swift/WEB/Cloud/VBA