Git Flow - Workflows
This repository represents a Git workflow, simplified through a series of actions displayed in a flowchart. The setup aligns with a basic Git flow, enabling us to maintain an agile and robust codebase.
The repository employs actions designed to follow a standard Git flow. This flow is organized into three main processes:
Development Process Developers create
feature/orbugfix/branches fromdevelop. Once complete, changes are pushed back via a pull request, ensuring quality through code reviews and approvals.Release Process A new
release/orhotfix/branch is manually created. Version numbers are automatically updated - minor forrelease/and patches forhotfix/. After QA testing, these branches merge intomain.Deployment Process Automated workflows handle deployment to STAGE and PROD environments. The
mainbranch is tagged and released on GitHub before deployment.
Manual triggers allow for a hotfix/ or release/ initiation, while automatic version bumping ensures smooth progression. By integrating these workflows, we provide a streamlined approach for code development, review, release, and deployment.
graph TB
subgraph "๐ Product"
subgraph release ["๐ข Release Process"]
direction TB
subgraph repo ["๐บ GH workflow"]
direction TB
A{{"๐ณ main"}}
tag>"๐ค๐ Tag -> ๐ฃ Release -> โฉ Sync -> ๐ Deploy"]
end
subgraph "๐๏ธ Manual Triggers"
Hf[/"๐โจ๏ธ Dispatch hotfix "/]
nR[/"๐๐ Dispatch next release"/]
end
subgraph automated["๐ค Auto bump & โ๏ธ branch"]
Ab{{"๐ณ main v1.0.0"}}
H>"โจ๏ธ hotfix/v1.0.1"]
Db{{"๐ฟ develop v1.0.0"}}
R>"๐ release/v1.1.0"]
Hf
==>
Ab
=="๐คโ๏ธ npm version patch"==>
H
nR
==>
Db
=="๐คโ๏ธ npm version minor"==>
R
end
end
direction TB
subgraph develop ["๐ง Development Process"]
D{{"๐ฟ develop"}}
=="๐จโ๐ป git checkout -b"==>
FB>"โจ feature/๐ bugfix/"]
=="๐ค on push:
โจ๐ [PR] > develop "==>
pr{"๐ PR Approved?"}
pr -."๐จโ๐ป๐ง
Code
Review
Feedback".-> FB
pr -."๐โ
Approve & Merge ๐".-> D
end
H-.->|"๐๐ Merge patch"|A
subgraph deploy ["๐ Deployment Process"]
direction LR
S((("STAGE ๐งช")))
D ==> |"๐ค on push:
๐ Deploy STAGE"|S
subgraph "STAGE ๐งช"
direction LR
S
T
end
subgraph "PROD ๐ฌ"
direction LR
P((("PROD ๐ฌ")))
BT("๐ New Ticket")
tag ==> |"๐ค ๐ Deploy PROD"|P
end
R ==>
|"๐๏ธ Passed QA Merge"|A
==>
|"๐ค on push"|tag
-.->
|"๐คโฉ Synchronize Dev"|D
T("๐ ๏ธ Reject Ticket")
P -.-> |"๐ต๏ธ QA Tests"|BT
S -.-> |"๐ต๏ธ QA Changes"|T
end
end
The
mainbranch represents the current state of our production code. Every commit tomainmirrors a released version of the product.Hotfixes are constructed from the
mainbranch and once completed, merged back into it. This workflow ensures that our production code remains up-to-date with any critical fixes.Any updates committed to the
mainbranch are automatically synchronized to thedevelopbranch by our trusty bot . This sync maintains consistency between our production and development codebases.Feature enhancements and bugfixes branch from
developand, once completed, are merged back intodevelop. This workflow allows for continuous integration and delivery.All releases are derived from the
developbranch and deployed first to the staging environment for rigorous testing and quality assurance.Once a
releasepasses QA testing , it gets merged intomain, aligning the production code with the latest version.Updates to the
mainbranch trigger a sequence of actions: tagging , releasing , publishing on GitHub, and deploying to production as necessary.Version bumping is fully automated through our actions, ensuring consistency and reducing manual error.
PRs are automatically created when branches with a prefix of
feature/orbugfix/are pushed. This feature streamlines the code review process.Two manual workflows exist to initiate a hotfix or release , providing us with control over these critical processes when necessary.
The Workflows:
- Announce Release: Announces a new release on GitHub corresponding to the version found in package.json.
- Build: Executes
npm ci,npm run test, andnpm run buildcommands. - Changelog CI: Generates a comprehensive changelog.
- Deploy Production : Deploys the application to the production environment.
- Deploy Staging : Deploys the application to the staging environment.
- Dispatch hotfix branch: Initiates a
hotfix/branch and auto-bumps thepatchnumber. - Dispatch next minor release: Initiates a
release/branch and auto-bumps theminornumber. - Dispatch next major release: Initiates a
release/branch and auto-bumps themajornumber. - [PR] bugfix > develop: Auto-generates a PR to
developbranch when abugfix/branch is pushed. - [PR] feature > develop: Auto-generates a PR to
developbranch when afeature/branch is pushed. - Publish Release: Executes
npm ci,npm run build, andnpm publishcommands. - Synchronize develop: Syncs
developbranch with any updates tomain. - Tag main: Tags the repo using the
versionfound inpackage.json, announces the release,