64
64
with :
65
65
name : ${{ inputs.artefact-name }}
66
66
- name : Unzip artefact
67
- run : |
68
- unzip cdk.out.zip
69
- - name : Set SAR name
67
+ run : unzip cdk.out.zip
68
+ - name : Configure SAR name
70
69
run : |
71
70
NAME=${{ env.SAR_NAME }}
72
71
if [[ "${{ inputs.stage }}" == "BETA" ]]; then
83
82
cp README.md LICENSE "./cdk.out/$asset/"
84
83
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
85
84
sam publish --template packaged.yml --region "$AWS_REGION"
86
- - name : Publish SAR
87
- if : ${{ inputs.stage == 'PROD' }}
88
- run : |
89
- # wait until sar registers the app, otherwise it fails to make it public
90
- sleep 15
91
- echo "Make SAR app public"
92
- aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }} --statements Principals='*',Actions=Deploy
93
85
- name : Deploy BETA canary
94
86
if : ${{ inputs.stage == 'BETA' }}
95
87
run : |
101
93
102
94
echo "Check if stack does not exist"
103
95
stack_exists=$(aws cloudformation list-stacks --query "StackSummaries[?(StackName == '$STACK_NAME' && StackStatus == 'CREATE_COMPLETE')].{StackId:StackId, StackName:StackName, CreationTime:CreationTime, StackStatus:StackStatus}" --output text)
104
- echo "$stack_exists"
105
96
if [[ -n "$stack_exists" ]] ; then
106
97
echo "Found test deployment stack, removing..."
107
98
aws cloudformation delete-stack --stack-name "$STACK_NAME"
@@ -124,3 +115,10 @@ jobs:
124
115
exit 1
125
116
fi
126
117
echo "Deployment successful"
118
+ - name : Publish SAR
119
+ if : ${{ inputs.stage == 'PROD' }}
120
+ run : |
121
+ # wait until SAR registers the app, otherwise it fails to make it public
122
+ sleep 15
123
+ echo "Make SAR app public"
124
+ aws serverlessrepo put-application-policy --application-id arn:aws:serverlessrepo:${{ env.AWS_REGION }}:${{ steps.aws-credentials-sar-role.outputs.aws-account-id }}:applications/${{ env.SAR_NAME }} --statements Principals='*',Actions=Deploy
0 commit comments