-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (37 loc) · 1.21 KB
/
serverless-deploy.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
on:
push:
branches:
- server-deploy
name: Serverless Deploy
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
root-project-path: [./serverless]
steps:
- uses: actions/checkout@v2
- name: setup ubuntu
run: sudo apt-get --quiet update --yes
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: yarn install
working-directory: ${{ matrix.root-project-path }}
run: yarn install
- name: serverless package and deploy
working-directory: ${{ matrix.root-project-path }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
yarn run serverless package --stage production --package ./build
yarn run serverless config credentials --provider aws --key ${AWS_ACCESS_KEY_ID} --secret ${AWS_SECRET_ACCESS_KEY}
yarn run serverless deploy --stage production --package ./build
- uses: actions/upload-artifact@v3
with:
name: build
path: ${{ matrix.root-project-path }}/build