You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize deployment flow with GHCR and pre-built images
- Build Docker images once in GitHub Actions, not on EC2
- Push multi-arch images (amd64/arm64) to GitHub Container Registry
- Reduce deployment time from 5-10 minutes to <30 seconds
- Minimize S3 usage to config files only (~few KB vs several MB)
- Update docker-compose.prod.yml to pull from GHCR instead of building
- Simplify CodeDeploy scripts to pull pre-built images
- Keep S3 bucket for minimal config delivery (appspec.yml, scripts)
- Update documentation with optimized deployment flow
- Configure IAM policies (Terraform, CodeDeploy, S3, GHCR)
75
85
- Generate access keys
76
86
- Output configuration for GitHub secrets
77
87
78
88
**Important**: Save the output - it contains bucket names and credentials.
79
89
90
+
**Note**: The S3 bucket for CodeDeploy now only stores small config files (~few KB), not the entire application code. Docker images are built in GitHub Actions and stored in GitHub Container Registry.
91
+
80
92
### 3. Configure Terraform Backend
81
93
82
94
```bash
@@ -233,12 +245,14 @@ git push origin v0.1.11
233
245
This will:
234
246
1. Run tests in GitHub Actions
235
247
2. Create a GitHub release with changelog
236
-
3. Package application and upload to S3
237
-
4. Create CodeDeploy deployment
238
-
5. CodeDeploy will:
248
+
3. Build multi-arch Docker image (amd64/arm64) and push to GHCR
249
+
4. Package config files (appspec.yml, docker-compose.prod.yml, scripts) and upload to S3
**Note**: The application is no longer built on the EC2 instance. Images are pre-built in GitHub Actions and stored in GitHub Container Registry (GHCR).
0 commit comments