-
Notifications
You must be signed in to change notification settings - Fork 16
54 lines (51 loc) · 1.92 KB
/
ci.yml
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
52
53
54
name: ci
on:
push:
pull_request:
types: [opened, reopened]
jobs:
build:
name: Build, Test, Lint
uses: ./.github/workflows/build.yml
deploy-staging:
name: Deploy to Staging
needs: [build]
if: github.ref_name == 'staging'
uses: opengovsg/deploy/.github/workflows/deploy.yml@latest
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID_STAGING }}
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_STAGING }}
aws-region: ${{ secrets.AWS_REGION }}
aws-ecr-repo: ${{ secrets.ECR_REPO }}
fly-org-name: ${{ secrets.ORG_NAME_STAGING }}
fly-app-name: ${{ secrets.APP_NAME_STAGING }}
fly-api-token: ${{ secrets.FLY_API_TOKEN }}
with:
env: "stg"
image-tag: ghactions-${{ github.ref_name }}-${{ github.sha }}
ecs-cluster-name: "cluster-application-server"
ecs-service-name: "application-server"
ecs-container-name: "app-server"
codedeploy-application: "AppECS-cluster-application-server"
codedeploy-deployment-group: "DgpECS-cluster-application-server"
deploy-production:
name: Deploy to Production
needs: [build]
if: github.ref_name == 'production'
uses: opengovsg/deploy/.github/workflows/deploy.yml@latest
secrets:
aws-account-id: ${{ secrets.AWS_ACCOUNT_ID_PROD }}
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_PROD }}
aws-region: ${{ secrets.AWS_REGION }}
aws-ecr-repo: ${{ secrets.ECR_REPO }}
fly-org-name: ${{ secrets.ORG_NAME_PROD }}
fly-app-name: ${{ secrets.APP_NAME_PROD }}
fly-api-token: ${{ secrets.FLY_API_TOKEN }}
with:
env: "prod"
image-tag: ghactions-${{ github.ref_name }}-${{ github.sha }}
ecs-cluster-name: "cluster-application-server"
ecs-service-name: "application-server"
ecs-container-name: "app-server"
codedeploy-application: "AppECS-cluster-application-server"
codedeploy-deployment-group: "DgpECS-cluster-application-server"