File tree Expand file tree Collapse file tree 2 files changed +29
-4
lines changed
Expand file tree Collapse file tree 2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,27 @@ jobs:
1616 runs-on : ubuntu-latest
1717 steps :
1818 - uses : actions/checkout@v1
19- - uses : mgenteluci/cloudformation-deploy-action@v1
19+ - uses : mgenteluci/cloudformation-deploy-action@v1.1.0
2020 env :
2121 TEMPLATE : ' template.yml'
22+ CAPABILITIES : ' CAPABILITY_IAM'
2223 AWS_STACK_NAME : ' my-stack'
2324 AWS_REGION : ' us-east-1'
2425 AWS_ACCESS_KEY_ID : ${{secrets.AWS_ACCESS_KEY_ID}}
2526 AWS_SECRET_ACCESS_KEY : ${{secrets.AWS_SECRET_ACCESS_KEY}}
2627 AWS_DEPLOY_BUCKET : ${{secrets.AWS_DEPLOY_BUCKET}}
2728` ` `
29+
30+ ### Environment Variables
31+
32+ * ` TEMPLATE` - [Optional]. YML file containing CloudFormation Stack. Default to `template.yml`.
33+ * `CAPABILITIES` - [Optional]. AWS Stack Capabilites. Default to `CAPABILITY_IAM`.
34+ * `AWS_STACK_NAME` - [**Required**]. The Stack name that is going to be published.
35+ * `AWS_REGION` - [**Required**]. AWS Region where to deploy the CloudFormation Stack.
36+ * `AWS_ACCESS_KEY_ID` - [**Required**]. AWS Access Key Id.
37+ * `AWS_SECRET_ACCESS_KEY` - [**Required**]. AWS Secret Access Key.
38+ * `AWS_DEPLOY_BUCKET` - [**Required**]. AWS S3 Bucket where the Stack package is going to be stored.
39+
40+ # ## License
41+
42+ The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE).
Original file line number Diff line number Diff line change 33set -e
44
55if [[ -z " $TEMPLATE " ]]; then
6- echo Empty template specified
7- exit 1
6+ echo Empty template specified. Searching template.yml...
7+
8+ if [[ ! -f " template.yml" ]]; then
9+ echo default template.yml not found
10+ exit 1
11+ fi
12+
13+ TEMPLATE=" template.yml"
814fi
915
1016if [[ -z " $AWS_STACK_NAME " ]]; then
@@ -32,6 +38,10 @@ if [[ -z "$AWS_DEPLOY_BUCKET" ]]; then
3238 exit 1
3339fi
3440
41+ if [[ -z " $CAPABILITIES " ]]; then
42+ CAPABILITIES=CAPABILITY_IAM
43+ fi
44+
3545mkdir ~ /.aws
3646touch ~ /.aws/credentials
3747touch ~ /.aws/config
@@ -46,4 +56,4 @@ output = text
4656region = $AWS_REGION " > ~ /.aws/config
4757
4858aws cloudformation package --template-file $TEMPLATE --output-template-file serverless-output.yaml --s3-bucket $AWS_DEPLOY_BUCKET
49- aws cloudformation deploy --template-file serverless-output.yaml --stack-name $AWS_STACK_NAME --capabilities CAPABILITY_IAM
59+ aws cloudformation deploy --template-file serverless-output.yaml --stack-name $AWS_STACK_NAME --capabilities $CAPABILITIES
You can’t perform that action at this time.
0 commit comments