Skip to content

Commit c1eb2e5

Browse files
committed
fix(*): update the readme and prduction deployment also
1 parent 3e4b468 commit c1eb2e5

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.github/workflows/cd-production.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Deploy Kaapi to EC2 Production
22

33
on:
44
push:
5-
branches:
6-
- release
5+
tags:
6+
- "v*" # Deploy only when tags like v1.0.0, v2.1.0, etc., are created
77

88
jobs:
99
deploy:

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,27 @@ Deployments are automated via a GitHub Actions CD pipeline that SSHes into the E
106106

107107
### Branch Strategy
108108

109-
| Branch | Environment |
110-
| --------- | ----------- |
111-
| `main` | Staging |
112-
| `release` | Production |
109+
| Trigger | Environment |
110+
| ------------------------------------- | ----------- |
111+
| Push to `main` | Staging |
112+
| Tag matching `v*.*.*` (e.g. `v1.0.0`) | Production |
113113

114114
### Pipeline Steps
115115

116-
On every push to `main` or `release`, the pipeline automatically:
116+
**Staging** — on every push to `main`, the pipeline automatically:
117117

118118
1. SSHes into the EC2 instance
119119
2. Runs `git pull` to fetch the latest code
120120
3. Runs `npm run build` to create an optimized production build
121121
4. Restarts the server to apply the new build
122122

123+
**Production** — on every version tag (e.g. `v1.0.0`, `v2.1.0`), the pipeline automatically:
124+
125+
1. SSHes into the EC2 instance
126+
2. Runs `git fetch --tags` and checks out the tag
127+
3. Runs `npm run build` to create an optimized production build
128+
4. Restarts the server to apply the new build
129+
123130
---
124131

125132
## Learn More

0 commit comments

Comments
 (0)