-
Notifications
You must be signed in to change notification settings - Fork 73
70 lines (70 loc) · 2.6 KB
/
deploy-prd-ecs.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
on:
release:
types: [released]
concurrency:
group: environment-prd-${{ github.ref }}
cancel-in-progress: true
name: Deploy Production ECS
jobs:
deploy-prd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
- name: Install Serverless Framework
run: npm install -g serverless@3
- name: Serverless AWS authentication
run: sls config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
- name: login-ecr
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Create ECS Repo
run: |
cd infrastructure/ecs-repo
npm ci
sls deploy --stage prd
sls deploy --stage dotcomprd
- uses: mr-smithers-excellent/docker-build-push@v5
name: build and push to ECR
with:
image: docs-worker-pool-prd
tags: latest, ${{ github.sha }}
registry: ${{ steps.login-ecr.outputs.registry }}
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- uses: mr-smithers-excellent/docker-build-push@v5
name: build and push to ECR Dotcom
with:
image: docs-worker-pool-dotcomprd
tags: latest, ${{ github.sha }}
registry: ${{ steps.login-ecr.outputs.registry }}
buildArgs: NPM_EMAIL=${{ secrets.NPM_EMAIL }},NPM_BASE_64_AUTH=${{ secrets.NPM_BASE64_AUTH }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NPM_BASE_64_AUTH: ${{ secrets.NPM_BASE64_AUTH }}
NPM_EMAIL: ${{ secrets.NPM_EMAIL }}
- name: Deploy ECS
run: |
cd infrastructure/ecs-main
npm ci
sls deploy --stage prd
sls deploy --stage dotcomprd
- name: Deploy Lambdas
run: |
npm ci
sls deploy --stage prd
sls deploy --stage dotcomprd
sls prune -n 5