-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (50 loc) · 1.87 KB
/
Copy pathdeploy-layer.yml
File metadata and controls
64 lines (50 loc) · 1.87 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
# This is a basic workflow to help you get started with Actions
name: Deploy APP
on:
push:
branches: [ stopped ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v1.4.2
with:
node-version: 12.x
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1
- name: Run a multi-line script
run: |
mkdir -p dist/nodejs
cp package.json dist/nodejs
cd dist/nodejs
yarn --production
cd ..
zip -r /tmp/lambda-layer.zip nodejs
- name: Deploy to Aws
run: aws lambda publish-layer-version --layer-name "geonode-layerv1" --description "NodeJS module for geo and postgres library" --license-info "MIT" --compatible-runtimes "nodejs12.x" --zip-file "fileb:////tmp/lambda-layer.zip" --output json >> layer.json
- name: Echo layer output
run: cat layer.json
- name: Update layer version on s3
run: aws s3 cp layer.json s3://samplenode-pro/develop/
- name: Get env stuff
run: |
cd $GITHUB_WORKSPACE
aws s3 cp s3://samplenode-pro/develop/develop.json .
aws s3 cp s3://samplenode-pro/develop/layer.json .
- name: Cache node modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Dependency
run: npm install serverless
- name: Geronimo
run: npx sls deploy --stage develop >> slsoutput.txt
- name: Update output version on s3
run: aws s3 cp slsoutput.txt s3://samplenode-pro/develop/