-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (34 loc) · 1.16 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Deploy AWS Lambda Function usando SAM
# Actions AWS usadas:
# - Setup SAM: https://github.com/marketplace/actions/setup-aws-sam-cli
# - Configure AWS Credentials: https://github.com/marketplace/actions/configure-aws-credentials-action-for-github-actions
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::175081627259:role/tech-challenge-oicd-githubactions
aws-region: us-east-1
# Build inside Docker containers
- run: sam build
# Prevent prompts and failure when the stack is unchanged
- run: |
sam deploy \
--no-confirm-changeset --no-fail-on-empty-changeset --resolve-s3 \
--parameter-overrides \
USERPOOL_ID=${{ secrets.USERPOOL_ID }} \
CLIENT_ID=${{ secrets.CLIENT_ID }} \
REGION=${{ secrets.REGION }}