Merge pull request #1 from jifalops/admin/secrets #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Lambda | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "pytest.ini" | |
- ".pytest.ini" | |
- "pyproject.toml" | |
- "pyproject.lock" | |
- "tests/**" | |
- "*.py" | |
- "app/**" | |
- ".github/workflows/deploy_lambda.yml" | |
jobs: | |
sam-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- run: | | |
pip install poetry | |
poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest | |
- uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- uses: aws-actions/setup-sam@v2 | |
- name: SAM Build | |
run: ./scripts/build-sam.sh | |
- name: SAM Deploy | |
run: | | |
cd deploy/aws_sam | |
sam deploy \ | |
--no-confirm-changeset \ | |
--no-fail-on-empty-changeset |