Skip to content

Commit

Permalink
fix: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Oct 13, 2022
1 parent c2e6ee5 commit 178c627
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ on:
latest_published_version:
description: "Latest PyPi published version to rebuild latest docs for, e.g. v2.0.0"
required: true
workflow_run:
workflows: ["Publish to PyPi"]
types:
- completed
# workflow_run:
# workflows: ["Publish to PyPi"]
# types:
# - completed

jobs:
build-layer:
Expand Down Expand Up @@ -65,8 +65,7 @@ jobs:
npm install -g [email protected]
cdk --version
- name: CDK build
run: |
cdk synth --context version="$RELEASE_TAG_VERSION" -o cdk.out
run: cdk synth --context version="$RELEASE_TAG_VERSION" -o cdk.out
- name: zip output
run: zip -r cdk.out.zip cdk.out
- name: Archive CDK artifacts
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/reusable_deploy_v2_sar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ jobs:
with:
name: ${{ inputs.artefact-name }}
- name: Unzip artefact
run: |
unzip cdk.out.zip
- name: Set SAR name
run: unzip cdk.out.zip
- name: Configure SAR name
run: |
NAME=${{ env.SAR_NAME }}
if [[ "${{ inputs.stage }}" == "BETA" ]]; then
Expand All @@ -83,13 +82,6 @@ jobs:
cp README.md LICENSE "./cdk.out/$asset/"
sam package --template-file template.yml --output-template-file packaged.yml --s3-bucket ${{ secrets.AWS_SAR_S3_BUCKET }}
sam publish --template packaged.yml --region "$AWS_REGION"
- name: Publish SAR
if: ${{ inputs.stage == 'PROD' }}
run: |
# wait until sar registers the app, otherwise it fails to make it public
sleep 15
echo "Make SAR app public"
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
- name: Deploy BETA canary
if: ${{ inputs.stage == 'BETA' }}
run: |
Expand All @@ -101,7 +93,6 @@ jobs:
echo "Check if stack does not exist"
stack_exists=$(aws cloudformation list-stacks --query "StackSummaries[?(StackName == '$STACK_NAME' && StackStatus == 'CREATE_COMPLETE')].{StackId:StackId, StackName:StackName, CreationTime:CreationTime, StackStatus:StackStatus}" --output text)
echo "$stack_exists"
if [[ -n "$stack_exists" ]] ; then
echo "Found test deployment stack, removing..."
aws cloudformation delete-stack --stack-name "$STACK_NAME"
Expand All @@ -124,3 +115,10 @@ jobs:
exit 1
fi
echo "Deployment successful"
- name: Publish SAR
if: ${{ inputs.stage == 'PROD' }}
run: |
# wait until SAR registers the app, otherwise it fails to make it public
sleep 15
echo "Make SAR app public"
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 comments on commit 178c627

Please sign in to comment.