Skip to content

Merge pull request #22 from JoseNoriegaa/fix/typo-serverless-lift-setup #28

Merge pull request #22 from JoseNoriegaa/fix/typo-serverless-lift-setup

Merge pull request #22 from JoseNoriegaa/fix/typo-serverless-lift-setup #28

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
generate-artifacts:
name: Generate SLS Layer Artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
npm i --omit=dev
mkdir nodejs
mv node_modules nodejs/node_modules
apt update -y && apt install zip -y
zip -r nodejs.zip nodejs
- uses: actions/upload-artifact@v4
with:
name: nodejs-artifact
path: nodejs.zip
deploy-lambdas:
name: Deploy Lambda
runs-on: ubuntu-latest
needs: generate-artifacts
steps:
- uses: actions/checkout@v4
- name: NPM - Load cached env
id: cached-npm-dependencies
uses: actions/cache@v4
with:
path: node_modules
key: npm-${{ runner.os }}-${{ hashFiles('**/package.json' )}}
- name: NPM - Install dependencies
if: steps.cached-npm-dependencies.output.cache-hit != 'true'
run: 'npm install'
- name: Download Layer Artifact
uses: actions/download-artifact@v4
with:
name: nodejs-artifact
path: layer-artifacts/
- name: SLS Deploy
run: 'npx sls deploy'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}