Skip to content

Commit

Permalink
Enable deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed May 7, 2024
1 parent d2a64a3 commit 15502fb
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jobs:
file_pattern: patterns.csv

deploy-aws-cdk:
needs: [test, scrape-book-types]
runs-on: ubuntu-latest
environment:
name: prod-aws-cdk
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
IAM_ROLE_ARN: ${{ needs.deploy-aws-cdk.outputs.iam-role-arn }}
environment:
name: prod-codedeploy
# url: ${{ steps.create-deployment.outputs.url }}
url: ${{ steps.create-deployment.outputs.url }}
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -188,25 +189,25 @@ jobs:
--s3-location s3://${{ env.S3_BUCKET }}/$S3_KEY \
--source codedeploy
# - name: Create CodeDeploy deployment
# id: create-deployment
# run: |
# response="$(aws deploy create-deployment \
# --application-name ${{ env.APPLICATION_NAME }} \
# --deployment-group-name ${{ env.DEPLOYMENT_GROUP_NAME }} \
# --s3-location "bucket=${{ env.S3_BUCKET }},key=${{ steps.upload-bundle.outputs.s3-key }},bundleType=zip")"
- name: Create CodeDeploy deployment
id: create-deployment
run: |
response="$(aws deploy create-deployment \
--application-name ${{ env.APPLICATION_NAME }} \
--deployment-group-name ${{ env.DEPLOYMENT_GROUP_NAME }} \
--s3-location "bucket=${{ env.S3_BUCKET }},key=${{ steps.upload-bundle.outputs.s3-key }},bundleType=zip")"
# deployment_id="$(echo "$response" | jq '.deploymentId' --raw-output)"
# url="https://${{ env.AWS_REGION }}.console.aws.amazon.com/codesuite/codedeploy/deployments/${deployment_id}?region=${{ env.AWS_REGION }}"
# echo "Deployment URL: $url"
deployment_id="$(echo "$response" | jq '.deploymentId' --raw-output)"
url="https://${{ env.AWS_REGION }}.console.aws.amazon.com/codesuite/codedeploy/deployments/${deployment_id}?region=${{ env.AWS_REGION }}"
echo "Deployment URL: $url"
# echo "deployment-id=$deployment_id" >> "$GITHUB_OUTPUT"
# echo "url=$url" >> "$GITHUB_OUTPUT"
echo "deployment-id=$deployment_id" >> "$GITHUB_OUTPUT"
echo "url=$url" >> "$GITHUB_OUTPUT"
# - name: Wait for deployment to finish
# run: |
# aws deploy wait deployment-successful \
# --deployment-id ${{ steps.create-deployment.outputs.deployment-id }}
- name: Wait for deployment to finish
run: |
aws deploy wait deployment-successful \
--deployment-id ${{ steps.create-deployment.outputs.deployment-id }}
# purge-deployments:
# needs: [deploy-aws-cdk, deploy-codedeploy]
Expand Down

0 comments on commit 15502fb

Please sign in to comment.