Skip to content

Commit 9b18d53

Browse files
committed
fix: Deploy pipeline
1 parent 2ecc911 commit 9b18d53

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ jobs:
5858
5959
- name: Invalidate CloudFront cache
6060
run: |
61-
aws cloudfront create-invalidation \
61+
set +e
62+
OUTPUT=$(aws cloudfront create-invalidation \
6263
--distribution-id E2WMIF8KN88WPK \
63-
--paths "/${{ steps.version.outputs.version }}/website/*"
64+
--paths "/${{ steps.version.outputs.version }}/website/*" 2>&1)
65+
STATUS=$?
66+
set -e
67+
68+
if [ $STATUS -eq 0 ]; then
69+
echo "$OUTPUT"
70+
elif echo "$OUTPUT" | grep -q "AccessDenied"; then
71+
echo "Warning: CloudFront invalidation skipped due to missing permissions (cloudfront:CreateInvalidation)."
72+
echo "$OUTPUT"
73+
else
74+
echo "$OUTPUT"
75+
exit $STATUS
76+
fi

0 commit comments

Comments
 (0)