Skip to content

Instantly share code, notes, and snippets.

@nirsky
Last active March 21, 2021 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirsky/26301b29a679bbcfb7495a431d30f503 to your computer and use it in GitHub Desktop.
Save nirsky/26301b29a679bbcfb7495a431d30f503 to your computer and use it in GitHub Desktop.
name: Deploy
on:
push:
branches: [ master ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
run: yarn
# build command should be set in your package.json scripts as: "build": "tsc"
- name: Build
run: yarn build
- name: Move node_modules to dist
run: mv node_modules dist/node_modules
- name: Zip
run: (cd dist && zip -r ../function.zip .)
- name: Deploy to AWS
uses: appleboy/lambda-action@master
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws_region: ${{ secrets.AWS_REGION }}
function_name: my-cool-function
zip_file: function.zip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment