Action to set up AWS SAM CLI and add it to the PATH
.
This Action enables you to run AWS SAM CLI commands in order to build, package, and deploy serverless applications as part of your workflow.
Requires Python 3.6+.
Assuming you have a samconfig.toml
at the root of your repository:
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: aws-actions/setup-sam@v1
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-2
# Build inside Docker containers
- run: sam build --use-container
# Prevent prompts and failure when the stack is unchanged
- run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset
See AWS IAM best practices for handling AWS credentials.
The AWS SAM CLI version to install. Installs the latest version by default.
The Python interpreter to use for AWS SAM CLI. Defaults to python
on Windows, and python3
otherwise.
You can use actions/setup-python
to automatically set up Python.
See CONTRIBUTING.md for more information.
This project is licensed under the Apache-2.0 License.