Dharav Patel’s Post

View profile for Dharav Patel, graphic

Computer Programming || software development

🚀 Day 21: Automating Deployments with Continuous Delivery (CD) Today I took the next big step in automating my development workflow by setting up Continuous Delivery (CD). With CI/CD in place, I now have an automated process that not only tests but also deploys my Node.js app whenever new code is merged into the main branch. Here’s how I made it happen: 1. Setting Up Continuous Delivery with GitHub Actions: After setting up Continuous Integration, I expanded the pipeline to include Continuous Delivery. Now, after every successful test, my app is automatically deployed to the server (in this case, Heroku). Here’s an overview of my updated GitHub Actions workflow: name: Node.js CI/CD on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '14' - run: npm install - run: npm test deploy: runs-on: ubuntu-latest needs: build steps: - uses: actions/checkout@v2 - name: Deploy to Heroku env: HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }} - run: git push https://lnkd.in/gTqk9DGm main This pipeline now builds, tests, and automatically deploys my app to Heroku if all tests pass! 2. Deploying to Heroku: I chose Heroku for its simplicity and ease of integration with GitHub. It allows me to deploy my app with just a git push command, and it scales effortlessly as the project grows. Now, with CD in place, my app gets deployed automatically after every successful push to the main branch! 3. Why Continuous Delivery Matters: CD ensures that my application is always in a deployable state. It saves time and reduces the risk of human error in manual deployments. This setup is crucial for faster development cycles, especially in production environments. 4. Next Steps: I’m going to further enhance my pipeline by adding environment-specific configurations for staging and production, ensuring that I can push changes safely to different environments. Up Next: Tomorrow, I’ll dive deeper into managing environment variables and secure deployment configurations! #Nodejs #ContinuousDelivery #GitHubActions #Heroku #CD #BackendDevelopment

To view or add a comment, sign in

Explore topics