Created
May 24, 2022 13:34
-
-
Save selvesandev/80bf8aa01cba993b472a4e4cc1fb5bac to your computer and use it in GitHub Desktop.
Deploy your serverless framework aws lambda function from aws code build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 0.2 | |
phases: | |
install: | |
runtime-versions: | |
nodejs: 12 | |
commands: | |
- npm install -g serverless | |
- npm install | |
- printenv | |
pre_build: | |
commands: | |
# checkout the version that are installed for the build process. | |
- npm --version | |
- sls --version | |
- aws --version | |
# - npm run migrate | |
- sls deploy --stage stage # "--stage stage" is optional | |
build: | |
commands: | |
- echo Build started on `date` | |
- ls | |
post_build: | |
commands: | |
- echo Build completed on `date` | |
cache: | |
paths: | |
- node_modules |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You might also have to give few policies (permissions) to the code build role so that the serverless can run the cloud formation and s3 uploads.