Skip to content

Commit 748b91e

Browse files
Copilotpethers
andcommitted
Fix S3 deployment: include screenshots, use --delete instead of --size-only, remove unused font sync
Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
1 parent f625dea commit 748b91e

1 file changed

Lines changed: 8 additions & 33 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ jobs:
104104
--exclude "*" \
105105
--include "*.js" \
106106
--exclude ".git/*" \
107-
--exclude "screenshots/*" \
108-
--size-only \
107+
--delete \
109108
--cache-control "public, max-age=31536000, immutable" \
110109
--content-type "application/javascript"
111110
@@ -115,27 +114,12 @@ jobs:
115114
--exclude "*" \
116115
--include "*.css" \
117116
--exclude ".git/*" \
118-
--exclude "screenshots/*" \
119-
--size-only \
117+
--delete \
120118
--cache-control "public, max-age=31536000, immutable" \
121119
--content-type "text/css"
122120
123-
# Sync font files with immutable cache headers (1 year)
124-
echo "🔤 Syncing font files..."
125-
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }}/ \
126-
--exclude "*" \
127-
--include "*.woff" \
128-
--include "*.woff2" \
129-
--include "*.ttf" \
130-
--include "*.eot" \
131-
--include "*.otf" \
132-
--exclude ".git/*" \
133-
--exclude "screenshots/*" \
134-
--size-only \
135-
--cache-control "public, max-age=31536000, immutable"
136-
137121
# Sync image files with immutable cache headers (1 year)
138-
echo "🖼️ Syncing image files..."
122+
echo "🖼️ Syncing image files (including screenshots)..."
139123
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }}/ \
140124
--exclude "*" \
141125
--include "*.webp" \
@@ -146,8 +130,7 @@ jobs:
146130
--include "*.svg" \
147131
--include "*.ico" \
148132
--exclude ".git/*" \
149-
--exclude "screenshots/*" \
150-
--size-only \
133+
--delete \
151134
--cache-control "public, max-age=31536000, immutable"
152135
153136
# Sync HTML files with short cache (1 hour) and must-revalidate
@@ -156,8 +139,7 @@ jobs:
156139
--exclude "*" \
157140
--include "*.html" \
158141
--exclude ".git/*" \
159-
--exclude "screenshots/*" \
160-
--size-only \
142+
--delete \
161143
--cache-control "public, max-age=3600, must-revalidate" \
162144
--content-type "text/html; charset=utf-8"
163145
@@ -169,20 +151,14 @@ jobs:
169151
--include "*.json" \
170152
--include "*.txt" \
171153
--exclude ".git/*" \
172-
--exclude "screenshots/*" \
173-
--size-only \
154+
--delete \
174155
--cache-control "public, max-age=86400"
175156
176157
# Catch-all sync for remaining files (no specific cache headers)
177158
echo "📦 Syncing remaining files..."
178159
aws s3 sync . s3://${{ env.S3_BUCKET_NAME }}/ \
179160
--exclude "*.js" \
180161
--exclude "*.css" \
181-
--exclude "*.woff" \
182-
--exclude "*.woff2" \
183-
--exclude "*.ttf" \
184-
--exclude "*.eot" \
185-
--exclude "*.otf" \
186162
--exclude "*.webp" \
187163
--exclude "*.png" \
188164
--exclude "*.jpg" \
@@ -195,12 +171,11 @@ jobs:
195171
--exclude "*.json" \
196172
--exclude "*.txt" \
197173
--exclude ".git/*" \
198-
--exclude "screenshots/*" \
199-
--size-only
174+
--delete
200175
201176
echo "✅ Optimized S3 deployment completed"
202177
echo "ℹ️ Cache headers set at upload time - no second pass needed"
203-
echo "ℹ️ Only changed files uploaded (--size-only flag)"
178+
echo "ℹ️ Content-based sync ensures all changes are detected"
204179
205180
# Invalidate CloudFront cache to ensure latest content is served
206181
- name: Invalidate CloudFront

0 commit comments

Comments
 (0)