-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (40 loc) · 1.2 KB
/
serverlessDeploy.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
name: Serverless deploy
on:
push:
branches:
- main
- dev
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Build dev .env.vault
if: github.ref_name == 'dev'
run: cp .env.vault.dev .env.vault
- name: Build prod .env.vault
if: github.ref_name == 'main'
run: cp .env.vault.prod .env.vault
- run: npm ci
- name: serverless deploy
uses: serverless/[email protected]
with:
args: deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DOTENV_KEY: ${{ secrets.DOTENV_KEY }}