docs
GitHub CI/CD Deployment
Deploy Production

CI/CD Production Deployment

Deploying to production requires careful attention, as it involves updating the live environment. To ensure that all changes have been thoroughly tested, we only deploy to production after the changes have been merged into the main branch via a pull request (PR) from the staging branch.

Once the pull request is approved and merged, our CI/CD pipeline will automatically trigger the deployment process.

Deployment Trigger:

  • Production: Changes are deployed when a PR from staging is merged into main.

⚠️ Please ensure that all changes are tested thoroughly in the staging environment before submitting a pull request for production deployment.

Step-by-Step

  1. Submit a Pull Request
    When you're confident in your changes, create a pull request from the staging branch to the main branch.

    • Click on New pull request.

    Create Permission Set

    • Select base:main and compare:staging. Click on Create pull request.

    Create Permission Set

    • Add a title and click on Create pull request.

    Create Permission Set

  2. Merge into Main
    Merge the changes into the main branch. This will automatically trigger the deployment to the production environment.

Create Permission Set Create Permission Set

  1. CI/CD Workflow
    As soon as the pull request is merged, the main.yml workflow will be executed. This workflow will:

    • Skip the test stage as the environment from staging has already been tested.
    • Deploy the application to the production environment.
    • Apply any necessary migrations and updates to the production database.

    Create Permission Set

  2. Verify the Production Deployment
    Once the workflow is complete, head over to the AWS Management Console of the Production account. Navigate to Load balancers and copy the DNS name for the production environment.

    Paste the DNS name into the browser to verify that your changes have been successfully deployed.

    Create Permission Set

💡 Always merge with caution! Production deployments affect the live environment, so ensure thorough testing on staging first.

By following these steps, you can confidently deploy updates to production while maintaining a stable and reliable environment for your users.


Great job! Now we can deploy our changes via CI/CD, and the process is fully automated! Next, let’s configure your domain for the backend API.