This deployment strategy is based on the github releases lifecycle
With this approach we have 2 main branches:
develop
: development branch, whatever is inside this branch is deployed to homologmain
: production branch, whatever is inside this branch is deployed to production
All release drafts are created automatically when we merge a PR to the main branch
The version is based on the semver 2.0.0 It is automatically increased by the release drafter based on the tags added to the PRs:
- major:
- π£ Breaking change
- minor:
- π Feature
- patch:
- π Bugfix
- π₯ Hotfix
- π Documentation
- ποΈ Refactor
- π§ͺ Test
- π¨ Security
- βοΈ CI
- no tag
How to deploy to each environment
- Merge a PR into
develop
branch
- Edit release draft
- Make sure
Set as a pre-release
is checked - Publish
- Edit the existing prerelease
- Uncheck
Set as a pre-release
- Check
Set as the latest release
- Save
To create a new hotfix, we must:
- Create a new branch (with the changes) starting with
hotfix/
(e.g.hotfix/failing-endpoint-x
) - A new PR pointing directly to the
main
branch will be created by an action - Edit it with the info about it and merge it
- It will deploy to production
- If no conflicts are found, it will merge automatically these changes to develop branch
- If conflicts are found, it will create a new branch and a PR pointing to
develop
in order to put the hotfix back to development - Resolve the conflicts and merge with
Merge commit
option