This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
46 lines (45 loc) · 1.83 KB
/
deploy-prod.yaml
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
#
# Github Actions for Serverless Framework
#
# Create AWS_KEY and AWS_SECRET secrets in Github repository settings
# If you're using env.yml file, store its content as ENV Github secret
#
# master branch will be deployed as PROD and every new tag starting with "v**" (e.g. v1.0, v1.2, v2.0, etc) will be deployed as PROD
#
# Learn more: https://maxkostinevich.com/blog/how-to-deploy-serverless-applications-using-github-actions/
#
name: Deploy Prod
on:
push:
branches:
- master
jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: "14.x"
- name: Install Serverless Framework
run: npm install -g serverless
- name: Serverless AWS authentication
run: sls config credentials --provider aws --key ${{ secrets.AWS_KEY }} --secret ${{ secrets.AWS_SECRET }}
- name: Create env file
run: |
echo -e 'MONGODB_URL_R="${{ secrets.PROD_MONGO_URL_R }}"' >> .env.prod
echo -e 'MONGODB_URL_RW="${{ secrets.PROD_MONGO_URL_RW }}"' >> .env.prod
echo -e 'MONGODB_URL="${{ secrets.PROD_MONGO_URL_RW }}"' >> .env.prod
echo -e 'COINGECKO_API_KEY="${{ secrets.COINGECKO_API_KEY }}"' >> .env.prod
echo -e 'MAKER_FEE_COLLECTOR_SEED="${{ secrets.MAKER_FEE_COLLECTOR_SEED }}"' >> .env.prod
echo -e 'GOVERNANCE_TRIGGER_BOT_SEED="${{ secrets.GOVERNANCE_TRIGGER_BOT_SEED }}"' >> .env.prod
- name: Install NPM dependencies
run: npm install
# Optional
#- name: Build assets
# run: npm run assets-prod
- name: Deploy Lambda functions
run: sls deploy -s prod
# Optional (to use with serverless-finch serverless plugin)
#- name: Deploy assets to S3
# run: sls client deploy --no-delete-contents --no-confirm -s prod