Skip to content

Commit 420dd04

Browse files
committed
feat: add cache refresh step to Azure deployment workflow for improved application performance
1 parent d9d85e3 commit 420dd04

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

.github/workflows/azure-dev.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ jobs:
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v4
39+
3940
- name: Install azd
4041
uses: Azure/setup-azd@v2
42+
4143
- name: Setup .NET
4244
uses: actions/setup-dotnet@v4
4345
with:
@@ -52,10 +54,30 @@ jobs:
5254
--tenant-id "$Env:AZURE_TENANT_ID"
5355
shell: pwsh
5456

55-
5657
- name: Provision Infrastructure
5758
run: azd provision --no-prompt
5859

5960
- name: Deploy Application
6061
run: azd deploy --no-prompt
61-
62+
63+
- name: Refresh Web App Cache
64+
if: success()
65+
run: |
66+
echo "Refreshing web application cache..."
67+
# Wait a moment for the deployment to fully complete
68+
sleep 5
69+
70+
# Call the cache refresh endpoint with API key authentication
71+
response=$(curl -s -w "%{http_code}" -X POST "https://copilotthatjawn.com/api/cache/refresh" \
72+
-H "X-API-Key: ${{ secrets.CACHE_REFRESH_API_KEY }}" \
73+
-o /tmp/cache_response.json)
74+
75+
if [ "$response" = "200" ]; then
76+
echo "Cache refresh successful"
77+
cat /tmp/cache_response.json
78+
else
79+
echo "Cache refresh failed with HTTP status: $response"
80+
cat /tmp/cache_response.json || echo "No response body"
81+
# Don't fail the workflow if cache refresh fails - it's not critical
82+
echo "Continuing workflow despite cache refresh failure..."
83+
fi

0 commit comments

Comments
 (0)