CircleCI is a continuos integration and continuos delivery platform, and Heroku is a clould platform as a service. Knowing this, you can use CircleCI to man age the delivery of your platform to provider to generate a new deploy for every git push or release.
Configuring CircleCI for Heroku
This part requires that you already have an account on CircleCI, a Docker image that builds your application and an account on Heroku with configured application.
Before all, you need generate $HEROKU_API_KEY
, you can do it by following the Heroku documentation. To a best practice to store these credentials is creating a context for them.
To configure CircleCI, you need to create a .circleci/config.yml
file in the root of your project. This file will contain the configuration for deploy your application to Heroku.
After that, you need define Heroku Orb in your config.yml
file, you can do it by adding the following line:
Later, you need to define the step that will be build your Dockerfile and push it to Heroku.
The deploy step will be build your Dockerfile, push it to Heroku and release to your application.
Conclusion
Integrating CircleCI with Heroku using Docker automates deployments, keeping your application up-to-date. This setup streamlines continuous delivery, reduces manual tasks, and enhances efficiency, allowing you to focus on development while maintaining a reliable deployment process.