Skip to content

Instantly share code, notes, and snippets.

@sobstel
Created October 1, 2020 16:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sobstel/df38c7a45f360b80272e82a8bb592e45 to your computer and use it in GitHub Desktop.
Save sobstel/df38c7a45f360b80272e82a8bb592e45 to your computer and use it in GitHub Desktop.
Deploy Ruby AWS lambda with github action
on:
push:
branches:
- "master"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: Build gems for AWS Lambda
run: |
bundle config set --local deployment 'true'
bundle config set --local without 'development'
docker run --rm -v "$PWD":/var/task lambci/lambda:build-ruby2.7 bundle install --jobs 4 --retry 3
- name: Deploy to AWS Lambda
uses: serverless/github-action@master
with:
args: deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment