Giter Club home page Giter Club logo

deploy-lambda-action's Introduction

Deploy Lambda Actions

This is a pair of actions to help deploy AWS Lambda functions with aws-cli.

pr-comment

the pr-comment action is to be used to comment on a merged PR to offer to deploy the lambda function to AWS.

The only secret it needs is the GITHUB_TOKEN variable to have access to push the comment to the required PR.

PR Comment

Usage

In this example workflow, I am using lannonbr/pr-merged-action to check if the PR was merged and if so create the comment.

workflow "Push Comment on PR merge" {
  on = "pull_request"
  resolves = ["Push Comment on PR"]
}

action "Check for PR Merge" {
  uses = "lannonbr/pr-merged-action@master"
  args = "true"
}

action "Push Comment on PR" {
  uses = "lannonbr/deploy-lambda-function/pr-comment@master"
  secrets = ["GITHUB_TOKEN"]
  needs = ["Check for PR Merge"]
}

deploy-lambda

This action does the process of deploying the lambda function to AWS. An example workflow is seen below where it watches on a PR comments to see if a comment by someone who has push access (which can be obtained with lannonbr/repo-push-check-action) writes "!deploy". If such, it uses the AWS cli tool with the various credentials to push the code up to AWS.

The credentials needed are as follows:

  • AWS_ACCESS_KEY_ID: Access Key for AWS.
  • AWS_SECRET_ACCESS_KEY: Access Key Secret for AWS
  • AWS_DEFAULT_REGION: AWS Region (ex: us-east-1)
  • AWS_LAMBDA_NAME: Name of the Lambda function

Usage

workflow "Deploy to Lambda" {
  on = "issue_comment"
  resolves = ["Deploy if comment contains !deploy"]
}

action "Check Push Access" {
  uses = "lannonbr/repo-push-check-action@master"
  secrets = ["GITHUB_TOKEN"]
}

action "Deploy if comment contains !deploy" {
  uses = "lannonbr/deploy-lambda-action/deploy-lambda@master"
  needs = ["Check Push Access"]
  secrets = ["AWS_ACCESS_KEY_ID", "AWS_DEFAULT_REGION", "AWS_LAMBDA_NAME", "AWS_SECRET_ACCESS_KEY"]
}

deploy-lambda-action's People

Contributors

jasonetco avatar lannonbr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jasonetco srt32

deploy-lambda-action's Issues

Extract !deploy portion out of deploy-lambda

In the entrypoint.sh file of deploy-lambda, there's a check to see if the comment of a PR includes the string "!deploy". I think it may be a good idea to extract that to a separate action.

A use case if such is done is I could write a workflow to deploy a task every single time there is a push to master.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.