Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove artifact cache invalidation #4041

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions .github/workflows/deploy-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
aws-region: us-east-1

- name: Deploy web
id: deploy-web
if: ${{ inputs.service == 'web' }}
run: |
ENVIRONMENT="${{ inputs.environment }}"
Expand Down Expand Up @@ -80,6 +79,20 @@ jobs:
exit 1
fi

- name: Invalidate web cache
if: ${{ inputs.service == 'web' }}
run: |
ENV=${{ inputs.environment }}
DIST_ID=$(aws cloudfront list-distributions --query "DistributionList.Items[?Comment=='$ENV-cdn'].Id | [0]" --output text)
# Create a CloudFront invalidation for all objects (/*)
invalidation_id=$(aws cloudfront create-invalidation --distribution-id $DIST_ID --paths "/*" --query 'Invalidation.Id' --output text)
# Check the status of the invalidation until it's completed
while [[ "$(aws cloudfront get-invalidation --distribution-id $DIST_ID --id $invalidation_id --query 'Invalidation.Status' --output text)" != "Completed" ]]; do
echo "Invalidation is still in progress. Waiting..."
sleep 5
done
echo "Invalidation is complete."

- name: Deploy service
if: ${{ inputs.service != 'web' }}
run: |
Expand Down Expand Up @@ -149,11 +162,3 @@ jobs:
echo "Version $VERSION for $SERVICE not found in the artifacts registry. Skipping!"
exit 1
fi

invalidate-cache:
if: ${{ inputs.service == 'web' }}
needs: deploy
uses: ./.github/workflows/invalidate-cache.yml
with:
environment: ${{ inputs.environment }}
secrets: inherit
8 changes: 1 addition & 7 deletions .github/workflows/deploy-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@ on:
default: "stable"

jobs:
invalidate-cache:
uses: ./.github/workflows/invalidate-cache.yml
with:
environment: shared
secrets: inherit

set-init:
uses: ./.github/workflows/set-init-version.yml
with:
Expand All @@ -70,7 +64,7 @@ jobs:
fi

deploy-services:
needs: ["invalidate-cache", "define-deployment-matrix"]
needs: "define-deployment-matrix"
strategy:
fail-fast: false
matrix:
Expand Down
34 changes: 0 additions & 34 deletions .github/workflows/invalidate-cache.yml

This file was deleted.

Loading