-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.66 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (48 loc) · 1.66 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
52
53
54
55
56
57
58
59
60
name: Deploy - Lambda Functions
on:
push:
branches:
- develop
- master
- test
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set env variable
run: echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- name: Get ENV from AWS SecretManager
uses: say8425/aws-secrets-manager-actions@v2
with:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
SECRET_NAME: ${{ env.SECRET_NAME }}
OUTPUT_PATH: './.env'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install NPM dependencies
run: |
npm ci
- name: Deploy Lambda functions - test
if: github.ref == 'refs/heads/test'
run: npm run deploy:test
- name: Deploy Lambda functions - develop
if: github.ref == 'refs/heads/develop'
run: npm run deploy:dev
# - name: Deploy Lambda functions - staging
# if: github.ref == 'refs/heads/staging'
# run: npm run deploy:stage
- name: Deploy Lambda functions - production
if: github.ref == 'refs/heads/master'
run: npm run deploy:prod