-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (47 loc) · 1.51 KB
/
deploy.yml
File metadata and controls
51 lines (47 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: 'Deploy'
# Triggers on pushes to main or demo branches
# Builds Docker image and pushes to:
# - GitHub Container Registry (ghcr.io)
# - AWS ECR (requires ECR repositories to exist first)
#
# PREREQUISITES:
# 1. Deploy infrastructure first to create ECR repositories:
# cd infra/cdktf
# pnpm deploy:flexion-sandbox-main # for main branch
# pnpm deploy:flexion-sandbox-demo # for demo branch
#
# 2. Configure GitHub secrets:
# - AWS_ACCOUNT_ID
# - AWS_ACCESS_KEY_ID
# - AWS_SECRET_ACCESS_KEY
#
# DEPLOYMENT FLOW:
# - Push to main branch → builds image → pushes to flexion-forms-sandbox-main ECR
# - Push to demo branch → builds image → pushes to flexion-forms-sandbox-demo ECR
# - App Runner auto-deploys when new images are detected (autoDeploymentsEnabled: true)
on:
push:
branches:
- main
- demo
workflow_dispatch:
jobs:
build-and-push-image:
uses: ./.github/workflows/_docker-build-image.yml
secrets: inherit
with:
app-name: sandbox
tag-name: ${{ github.ref_name }}
deploy-key: ${{ github.ref_name }}
# Terraform deployment is handled separately/manually for now
# To deploy infrastructure changes:
# cd infra/cdktf
# DEPLOY_ENV=flexion-sandbox-main pnpm deploy # or flexion-sandbox-demo
#
# Future: Automate Terraform deployment for AWS
# deploy-infrastructure:
# needs: [build-and-push-image]
# uses: ./.github/workflows/_terraform-apply.yml
# secrets: inherit
# with:
# deploy-env: aws-${{ github.ref_name }}