rails-lambda / lamby

🐑🛤 Simple Rails & AWS Lambda Integration
https://lamby.cloud
MIT License
602 stars 29 forks source link

More Runner Documentation #101

Closed metaskills closed 3 years ago

metaskills commented 3 years ago

Right now we only mention the runner in the context of DB migrations here (https://lamby.custominktech.com/docs/database_options#rails-database-migrations) but there is a lot more to the story. Share how it can be used with the Rails' runner and maybe showcase a GitHub Action example.

      - name: Inovke
        run: |
          echo $'${{ github.event.inputs.payload }}' > payload.json
          FUNCTION_NAME=$(aws cloudformation describe-stack-resources \
            --stack-name "$STACK_NAME" \
            --query "StackResources[?LogicalResourceId=='RailsLambda'].PhysicalResourceId" \
            --output text)
          aws lambda invoke \
            --function-name "$FUNCTION_NAME" \
            --cli-binary-format raw-in-base64-out \
            --payload file://./payload.json \
            /dev/stdout | jq -r .body