-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (65 loc) · 2.05 KB
/
sam-pipeline.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Deploy AWS SAM Resources
on:
workflow_dispatch:
inputs:
region:
description: 'AWS Region'
required: true
default: 'us-east-1'
environment:
type: choice
options:
- dev
- prd
description: 'Environment (dev or prd)'
required: true
default: 'dev'
env:
APP_ID: wbornor-splayshapi
AWS_REGION: us-east-1
AWS_CICD_ROLE_ARN: arn:aws:iam::796019718156:role/splayshapi-cicd-DeployerRole-ReOfpb4FBtBc
AWS_SAM_EXECUTION_ROLE_ARN: arn:aws:iam::796019718156:role/splayshapi-cicd-CloudFormationExecutionRole-FjUNsyRX1Ixf
AWS_CICD_BUCKET: wbornor-splayshapi-deployment-bucket
jobs:
stack:
name: Deploy stack to AWS
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- name: Configure AWS credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ env.AWS_CICD_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup SAM
uses: aws-actions/setup-sam@v2
with:
use-installer: true
# sam build
- name: SAM Build
run: sam build --use-container
# sam deploy
- name: SAM Deploy
run: |
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--stack-name "$APP_ID-${{ github.event.inputs.environment }}" \
--role-arn "$AWS_SAM_EXECUTION_ROLE_ARN" \
--s3-bucket "$AWS_CICD_BUCKET" \
--capabilities CAPABILITY_IAM \
--region "$AWS_REGION"
# - name: Deploy splayshapi aws resources
# id: splayshapi
# uses: aws-actions/aws-cloudformation-github-deploy@master
# with:
# name: ${{ steps.env-name.outputs.environment }}-splayshapi
# template: "file:///infra/sam-pipeline.yml"
# no-fail-on-empty-changeset: "1"