-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.44 KB
/
actions.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
on:
workflow_dispatch:
push:
branches:
- main
paths-ignore:
- ".github/workflows/*"
- "**.md"
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup AWS SAM CLI
uses: aws-actions/setup-sam@v2
with:
use-installer: true
- name: Setup AWS Credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true
- name: Build SAM packages
run: sam build --use-container
- name: Deploy SAM application
env:
BUCKET_NAME: ${{ secrets.PROVISIONING_BUCKET_NAME }}
REGION: ${{ secrets.AWS_REGION }}
STACK_NAME: ${{ vars.STACK_NAME }}
run: |
sam deploy \
--template-file .aws-sam/build/template.yaml \
--stack-name $STACK_NAME \
--s3-bucket $BUCKET_NAME \
--s3-prefix $STACK_NAME \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--region $REGION \
--force-upload \
--no-confirm-changeset \
--no-fail-on-empty-changeset