Skip to content

Commit 30400f0

Browse files
authored
Merge pull request #299 from DevKor-github/codexd/remove-dev-deploy-workflow
Remove dev server deployment workflow
2 parents 3da77c2 + 64bfb6f commit 30400f0

4 files changed

Lines changed: 27 additions & 237 deletions

File tree

.github/workflows/deploy-dev.yml

Lines changed: 0 additions & 185 deletions
This file was deleted.

docs/deployment.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ Firebase:
7171

7272
- `FIREBASE_CREDENTIALS_BASE64`
7373

74-
Development server:
75-
76-
- `DEV_EC2_HOST`
77-
- `DEV_EC2_USER`
78-
- `DEV_EC2_SSH_KEY`
79-
- `DEV_BACKEND_HTTP_PORT` (optional, defaults to `8081`)
80-
- Runtime secrets matching the production names with a `DEV_` prefix, for example `DEV_SPRING_DATASOURCE_URL`, `DEV_JWT_SECRETKEY`, and `DEV_FIREBASE_CREDENTIALS_BASE64`
81-
8274
Set the base64 secrets from the ignored local credential files:
8375

8476
```bash
@@ -93,7 +85,7 @@ base64 -i ontime-back/src/main/resources/key/AuthKey_743M7R5W3W.p8 | tr -d '\n'
9385

9486
Push to the `main` branch, or run `.github/workflows/deploy.yml` manually, to deploy production.
9587

96-
Push to the `dev` branch, or run `.github/workflows/deploy-dev.yml` manually, to deploy the development server.
88+
Pushes to `dev` run CI only. There is no dev-server deploy workflow in the one-EC2 plan.
9789

9890
The workflow:
9991

docs/git-workflow.md

Lines changed: 25 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Git Workflow And Deployment Strategy
1+
# Git Workflow And Production Deployment Strategy
22

3-
This document describes the recommended Git strategy for OnTime-back when running both a development server and a production server.
3+
This document describes the recommended Git strategy for OnTime-back with one production EC2 server and one private production RDS instance.
44

55
## Goals
66

77
- Keep one clear production source of truth.
8-
- Support a separate development server for integration testing.
98
- Make every server deployment traceable to a Git branch and commit.
109
- Avoid using deployment branches as places where product code diverges.
1110
- Keep feature branches short-lived and easy to review.
11+
- Keep `dev` as an integration branch only; it must not deploy a long-running dev backend.
1212

1313
## Branch Model
1414

1515
Use a lightweight environment-branch workflow:
1616

1717
```text
1818
feature/*, fix/*, chore/* -> short-lived work branches
19-
dev -> development server source
19+
dev -> integration branch for CI and review
2020
main -> production server source
2121
```
2222

@@ -25,7 +25,7 @@ Branch responsibilities:
2525
| Branch | Purpose | Deployment |
2626
| --- | --- | --- |
2727
| `main` | Production-ready code and source of truth | Production server |
28-
| `dev` | Integrated code for QA, frontend/mobile testing, and pre-release validation | Development server |
28+
| `dev` | Integrated code for QA, frontend/mobile testing, and pre-release validation | No direct deployment |
2929
| `feature/*` | New feature work | No direct deployment |
3030
| `fix/*` | Bug fixes | No direct deployment |
3131
| `chore/*` | Maintenance, docs, config, CI changes | No direct deployment |
@@ -59,21 +59,19 @@ feature/* -> dev
5959

6060
5. After review, merge into `dev`.
6161

62-
6. GitHub Actions deploys the updated `dev` branch to the development server.
62+
6. Validate the integrated code without running a long-lived dev backend on EC2.
6363

64-
7. Validate the change using the development server.
65-
66-
8. When the release candidate is ready, open a pull request from `dev` into `main`.
64+
7. When the release candidate is ready, open a pull request from `dev` into `main`.
6765

6866
```text
6967
dev -> main
7068
```
7169

72-
9. After review and CI pass, merge into `main`.
70+
8. After review and CI pass, merge into `main`.
7371

74-
10. GitHub Actions deploys `main` to the production server.
72+
9. GitHub Actions deploys `main` to the production server.
7573

76-
11. Tag the production release.
74+
10. Tag the production release.
7775

7876
```bash
7977
git tag prod-YYYY-MM-DD
@@ -82,65 +80,50 @@ git push origin prod-YYYY-MM-DD
8280

8381
## Server Mapping
8482

85-
Use branch-based deployments with separate GitHub Actions environments:
83+
Use branch-based CI and production deployment:
8684

8785
```text
88-
push to dev -> development environment -> dev server
86+
pull_request to dev/main -> test workflow
8987
push to main -> production environment -> production server
9088
```
9189

9290
Recommended GitHub environments:
9391

9492
| Environment | Source Branch | Server | Approval |
9593
| --- | --- | --- | --- |
96-
| `development` | `dev` | Dev server | Usually automatic |
9794
| `production` | `main` | Production server | Manual approval recommended |
9895

9996
## CI/CD Workflow
10097

101-
Use either two workflows or one branch-aware workflow.
102-
10398
Recommended simple setup:
10499

105100
```text
106101
.github/workflows/test.yml
107-
.github/workflows/deploy-dev.yml
108-
.github/workflows/deploy-prod.yml
102+
.github/workflows/deploy.yml
109103
```
110104

111105
Expected triggers:
112106

113107
```text
114108
pull_request to dev -> run tests
115109
pull_request to main -> run tests
116-
push to dev -> deploy to dev server
110+
push to dev -> no deployment
117111
push to main -> deploy to production server
118112
workflow_dispatch -> allow manual redeploy or rollback support
119113
```
120114

121-
Development deploy should use development secrets only:
122-
123-
```text
124-
DEV_EC2_HOST
125-
DEV_EC2_USER
126-
DEV_EC2_SSH_KEY
127-
DEV_DATASOURCE_URL
128-
DEV_DATASOURCE_USERNAME
129-
DEV_DATASOURCE_PASSWORD
130-
```
131-
132115
Production deploy should use production secrets only:
133116

134117
```text
135-
PROD_EC2_HOST
136-
PROD_EC2_USER
137-
PROD_EC2_SSH_KEY
138-
PROD_DATASOURCE_URL
139-
PROD_DATASOURCE_USERNAME
140-
PROD_DATASOURCE_PASSWORD
118+
EC2_HOST
119+
EC2_USER
120+
EC2_SSH_KEY
121+
SPRING_DATASOURCE_URL
122+
SPRING_DATASOURCE_USERNAME
123+
SPRING_DATASOURCE_PASSWORD
141124
```
142125

143-
Do not share databases, Firebase credentials, OAuth redirect URIs, or private keys between development and production unless there is a deliberate reason.
126+
Do not add `DEV_*` deployment secrets or a dev-server workflow unless the infrastructure plan changes deliberately.
144127

145128
## Branch Protection
146129

@@ -188,7 +171,7 @@ The current repository has `main` and `deploy` as separate long-lived branches.
188171
```text
189172
deploy branch -> retired
190173
main branch -> production
191-
dev branch -> development server
174+
dev branch -> integration and CI only
192175
```
193176

194177
Recommended migration sequence:
@@ -206,8 +189,8 @@ git push origin dev
206189
```
207190

208191
5. Change production deployment to trigger from `main`.
209-
6. Add development deployment to trigger from `dev`.
210-
7. Update GitHub environment secrets for `development` and `production`.
192+
6. Ensure there is no workflow that deploys from `dev`.
193+
7. Update GitHub production environment secrets.
211194
8. Protect `main` and `dev`.
212195
9. Stop using `deploy` for new work.
213196
10. Delete or archive stale merged feature branches after confirming they are no longer needed.
@@ -218,7 +201,7 @@ git push origin dev
218201
- Normal PR target is `dev`.
219202
- Release PR target is `main`.
220203
- Production deploys only from `main`.
221-
- Development deploys only from `dev`.
204+
- `dev` runs CI only and does not deploy.
222205
- Do not commit directly to `main`.
223206
- Do not commit directly to `dev` unless it is an emergency coordination fix.
224207
- Delete feature branches after merge.

ontime-back/docs/deployment/ec2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This service deploys to Amazon EC2 through `.github/workflows/deploy.yml`.
66

77
1. Make sure the EC2 instance has Docker installed and the security group allows inbound traffic for the service port, currently `8080`.
88
2. Add the required GitHub Actions secrets listed below.
9-
3. Run the `Deploy` workflow manually from GitHub Actions, or push to the `deploy` branch.
9+
3. Run the `Deploy` workflow manually from GitHub Actions, or push to the `main` branch.
1010

1111
The workflow builds a Docker image, pushes it to GHCR, uploads `docker-compose.yml` to `/home/ubuntu/OnTime-back`, writes a production `.env` from GitHub Secrets, verifies private RDS connectivity, and restarts Docker Compose on the EC2 instance.
1212

0 commit comments

Comments
 (0)