0
0
Firebasecloud~30 mins

Rollback deployments in Firebase - Mini Project: Build & Apply

Choose your learning style9 modes available
Rollback Deployments with Firebase Hosting
📖 Scenario: You are managing a website hosted on Firebase Hosting. Sometimes, after deploying new changes, you realize there is a problem and want to quickly go back to a previous working version.This project will guide you through setting up your Firebase Hosting project and learning how to rollback to a previous deployment.
🎯 Goal: Set up Firebase Hosting for a website and learn how to rollback to a previous deployment version using Firebase CLI commands.
📋 What You'll Learn
Initialize a Firebase Hosting project with a public directory
Deploy the website to Firebase Hosting
List previous deployments
Rollback to a previous deployment version
💡 Why This Matters
🌍 Real World
Websites often need quick fixes when new deployments cause issues. Rollbacks let you restore a stable version fast.
💼 Career
Knowing how to manage deployments and rollbacks is essential for cloud engineers and web developers working with Firebase Hosting.
Progress0 / 4 steps
1
Initialize Firebase Hosting Project
Create a Firebase Hosting project by running firebase init hosting and set the public directory to public. Then create a simple index.html file inside the public folder with the content <h1>Welcome to Firebase Hosting</h1>.
Firebase
Need a hint?

Use the Firebase CLI to initialize hosting and create the public folder with an index.html file.

2
Deploy the Website to Firebase Hosting
Deploy your website by running the command firebase deploy --only hosting. This will upload your public folder content to Firebase Hosting.
Firebase
Need a hint?

Use the Firebase CLI deploy command to publish your site.

3
List Previous Deployments
Use the command firebase hosting:versions:list to list all previous deployment versions for your Firebase Hosting site. This helps you find the version ID to rollback to.
Firebase
Need a hint?

Use the Firebase CLI to list deployment versions so you can choose one to rollback to.

4
Rollback to a Previous Deployment Version
Rollback your Firebase Hosting site to a previous deployment version by running firebase hosting:clone VERSION_ID, replacing VERSION_ID with the exact version ID you want to restore from the list.
Firebase
Need a hint?

Replace VERSION_ID with the actual version ID from the list to rollback.