/
action.yml
52 lines (50 loc) · 1.96 KB
/
action.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
name: "SAM Build & Deploy"
description: "Build & Deploy SAM application"
inputs:
aws-access-key:
required: true
description: "AWS Access Key"
aws-secret-key:
required: true
description: "AWS Secret Key"
aws-region:
required: true
description: "AWS Region"
dotnet-version:
required: true
description: ".NET Version to configure"
template-file-path:
required: true
description: "Path to the SAM template file"
project-directory:
required: true
description: "Path to the directory containing the .NET project file"
stack-name:
required: true
description: "The name of the CloudFormation stack to deploy"
s3-bucket-name:
required: true
description: "The name of the S3 bucket to store SAM artifacts"
runs:
using: "composite"
steps:
- uses: actions/setup-python@v2
- uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ inputs.dotnet-version }}
- uses: aws-actions/setup-sam@v2
with:
use-installer: true
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ inputs.aws-access-key }}
aws-secret-access-key: ${{ inputs.aws-secret-key }}
aws-region: ${{ inputs.aws-region }}
# Build and deploy x86
# Because native apps are built in a container, and SAM CLI doesn't know how to mount extra things outside the project directory to the container, move this file manually
- run: cp Directory.Build.props ${{ inputs.project-directory }}/Directory.Build.props
shell: bash
- run: sam build -t ${{ inputs.template-file-path }} --parameter-overrides LambdaArchitecture=x86_64
shell: bash
- run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name ${{inputs.stack-name}}-x86-64 --s3-prefix ${{inputs.stack-name}}-x86_64 --s3-bucket ${{ inputs.s3-bucket-name }} --capabilities CAPABILITY_IAM --parameter-overrides LambdaArchitecture=x86_64
shell: bash