Advertisement
Advanced Node.js, Git & Project Management

How would you use Git tags in combination with a CI/CD pipeline to trigger a production release of a Node.js application?

Short answer

Tagging a specific commit with a version identifier (like v1.2.3) creates an immutable reference to that exact point in history -- a CI/CD pipeline can be configured to trigger a production deployment workflow specifically when a new tag matching a version pattern is pushed…

Save Node.js mock interview
Advertisement
AModel answer
Tagging a specific commit with a version identifier (like v1.2.3) creates an immutable reference to that exact point in history -- a CI/CD pipeline can be configured to trigger a production deployment workflow specifically when a new tag matching a version pattern is pushed, distinct from the regular CI checks that run on every commit or pull request, providing a clear, deliberate, and auditable trigger for exactly when and what gets deployed to production.
# .github/workflows/release.yml
on:
  push:
    tags: ['v*.*.*']
jobs:
  deploy:
    steps:
      - uses: actions/checkout@v4
      - run: docker build -t myapp:${{ github.ref_name }} .
      - run: ./deploy-to-production.sh
Real-world example
A team's production deployments only happen when a maintainer explicitly creates and pushes a version tag like v2.3.0, giving a clear, deliberate, and fully auditable record of exactly which commit corresponds to each production release, distinct from the continuous merges happening to the main branch.
Likely follow-ups
  • What's the difference between an annotated Git tag and a lightweight tag, and which is generally recommended for release tagging?
  • How would you handle rolling back to a previous tagged release if the newly deployed version has a critical bug?
Related topics