-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 2.08 KB
/
Copy pathdeploy.yml
File metadata and controls
71 lines (58 loc) · 2.08 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
61
62
63
64
65
66
67
68
69
70
71
name: Deploy SAM
on:
push:
branches: [dev]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- uses: aws-actions/setup-sam@v2
- name: Configure AWS Credentials (Dev)
if: github.event_name == 'push'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: Configure AWS Credentials (Prod)
if: github.event_name == 'workflow_dispatch'
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-1
- name: Install dependencies
run: npm ci
- name: Install esbuild
run: npm install -g esbuild
- name: Build
run: sam build
- name: Copy external packages into Lambda artifact
run: |
mkdir -p .aws-sam/build/StorageFunction/node_modules
cp -r node_modules/security-context .aws-sam/build/StorageFunction/node_modules/
- name: Deploy Dev
if: github.event_name == 'push' && github.ref == 'refs/heads/dev'
run: |
sam deploy \
--stack-name trustvc-storage-dev \
--resolve-s3 \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM \
--parameter-overrides Env=dev
- name: Deploy Prod
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master'
run: |
sam deploy \
--stack-name trustvc-storage-prod \
--resolve-s3 \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM \
--parameter-overrides Env=prod