File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments