Replace CloudFront invalidation with API Gateway endpoint

This commit is contained in:
Evgeniy Antonyuk
2025-12-18 12:39:58 +00:00
parent c2074bbff6
commit cd4d5b180e

View File

@ -119,7 +119,7 @@ jobs:
env:
URI: ${{steps.tag-dir.outputs.URI}}
run: |
aws cloudfront create-invalidation \
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID }} \
--paths \
"${URI}/*"
API_STATUS=$(aws apigateway test-invoke-method --rest-api-id ${{ secrets.AWS_REST_API_ID }} --resource-id "${{ secrets.AWS_RESOURCE_ID }}" \
--http-method PUT --path-with-query-string "/prod/download-oo-com" --body "$(jq -c -n '.paths = $ARGS.positional' --args "${URI}/*")" \
--region us-east-1 --query 'status' --output text || :)
echo "API Gateway test-invoke status: ${API_STATUS:-<failed>}"