I have a small front-end project with javascript running on firebase hosting and I have to call the build script manually before every time I run firebase deploy
. So I was looking for a way to put it in a pre-deploy script but there's no such thing in firebase CLI documentation.
So anyone has any idea how to make it done?
The firebase. json file is required to deploy assets with the Firebase CLI because it specifies which files and settings from your project directory are deployed to your Firebase project.
You cannot change hosted files in the Firebase Console. Instead, you should change the index. html on your local copy where you initially ran the firebase deploy command. Once you're done with the changes, run firebase deploy again to push the updated version of your website to Firebase Hosting.
If you are already signed in to the new Firebase Console with the same Google account as you used on firebase.com , then you should see your firebase.com project listed under "Projects currently at Firebase.com". Follow the instructions on the new Firebase upgrade page for Web, Android or iOS.
Go to Firebase Console and select Hosting from the menu of the left. actions like Deployed, disabled, etc. menu will be available for you to choose the action to delete the deployment.
Predeploy supports in latest Firebase CLI, please update your CLI and create predeploy
in firebase.json
file.
"hosting": {
"predeploy": "npm run build",
"public": "build",
There is documentation for predeploy hooks with the Firebase CLI.
For any of the assets you can deploy—hosting, functions, database, storage, and firestore— you can add predeploy and postdeploy hooks in firebase.json, and your scripts will run with the corresponding deployment command. Both predeploy and postdeploy hooks print the standard output and error streams of the scripts to the terminal.
For example:
{
"hosting":{
"postdeploy":"./messageSlack.sh 'Just deployed to Firebase Hosting'",
"public":"public"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With