CI/CD for web deployment
By Vinay Saurabh • Published on
A simple approach to deploying your websites using github and firebase hosting

Introduction to CI/CD
Why continuous integration and deployment matters in modern web development.
- Automates testing and deployment processes
- Ensures faster and more reliable updates
- Minimizes manual errors and downtime
Tools You Need
A minimal setup to get started with CI/CD for web deployment.
- GitHub - for source control and actions
- Firebase Hosting - for fast and secure web hosting
- GitHub Actions - for automating deployment workflows
Project Structure
Organize your codebase for effective deployment.
my-project/
├── public/
│ └── index.html
├── .github/
│ └── workflows/
│ └── deploy.yml
└── firebase.json
Setting Up Firebase Hosting
Connect your project with Firebase for seamless hosting.
- Install Firebase CLI:
npm install -g firebase-tools
- Login:
firebase login
- Initialize:
firebase init hosting
- Deploy manually:
firebase deploy
Creating the GitHub Action
Write a workflow to deploy automatically on push to main branch.
name: Deploy to Firebase
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install -g firebase-tools
- run: firebase deploy --token=${{ secrets.FIREBASE_TOKEN }}
Setting Up Secrets
Securely store your Firebase token in GitHub.
- Generate a CI token:
firebase login:ci
- Go to your GitHub repo → Settings → Secrets
- Add a new secret named
FIREBASE_TOKEN
Final Thoughts
CI/CD brings peace of mind and speed to your workflow.
- Set up once, deploy effortlessly every time
- Great for teams and solo developers
- Integrate testing for even better automation