-
Notifications
You must be signed in to change notification settings - Fork 1
chore/update-cloudfront-action #4
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,48 +17,75 @@ outputs: | |
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Upload new assets to S3 | ||
| - name: Upload immutable Nuxt assets to S3 | ||
| shell: bash | ||
| run: | | ||
| aws s3 sync .output/public/_nuxt/ s3://${{ inputs.s3-bucket }}/_nuxt/ --follow-symlinks \ | ||
| --exclude "*.map" \ | ||
| --exclude "builds/*" \ | ||
| --exclude "manifest.json" \ | ||
| --cache-control "public,max-age=2592000,immutable" | ||
|
|
||
| - name: Upload cacheable static assets to S3 | ||
| shell: bash | ||
| run: | | ||
| aws s3 sync .output/public/ s3://${{ inputs.s3-bucket }}/ --follow-symlinks \ | ||
| --exclude "*.html" --exclude "*.map" \ | ||
| --exclude "_nuxt/builds/*" --exclude "_nuxt/manifest.json" \ | ||
| --exclude "robots.txt" --exclude "favicon*" \ | ||
| --exclude "manifest.json" --exclude "site.webmanifest" \ | ||
| --exclude "browserconfig.xml" --exclude "sitemap.xml" \ | ||
| --cache-control "max-age=2592000,public" \ | ||
| --expires 2034年01月01日T00:00:00Z | ||
| --exclude "_nuxt/*" \ | ||
| --exclude "*.html" \ | ||
| --exclude "*.map" \ | ||
| --exclude "_payload.json" \ | ||
| --exclude "*/_payload.json" \ | ||
| --exclude "robots.txt" \ | ||
| --exclude "favicon*" \ | ||
| --exclude "manifest.json" \ | ||
| --exclude "site.webmanifest" \ | ||
| --exclude "browserconfig.xml" \ | ||
| --exclude "sitemap.xml" \ | ||
| --cache-control "public,max-age=2592000" | ||
|
|
||
| - name: Upload HTML and no-cache files to S3 | ||
| shell: bash | ||
| run: | | ||
| aws s3 sync .output/public/ s3://${{ inputs.s3-bucket }}/ --follow-symlinks \ | ||
| --exclude "*" --include "*.html" \ | ||
| --cache-control "no-cache" | ||
| --exclude "*" \ | ||
| --include "*.html" \ | ||
| --include "_payload.json" \ | ||
| --include "*/_payload.json" \ | ||
| --cache-control "no-cache,max-age=0" | ||
|
|
||
| aws s3 sync .output/public/ s3://${{ inputs.s3-bucket }}/ --follow-symlinks \ | ||
| --exclude "*" \ | ||
| --include "_nuxt/builds/*" --include "_nuxt/manifest.json" \ | ||
| --include "robots.txt" --include "favicon*" \ | ||
| --include "manifest.json" --include "site.webmanifest" \ | ||
| --include "browserconfig.xml" --include "sitemap.xml" \ | ||
| --cache-control "no-cache" | ||
| --include "_nuxt/builds/*" \ | ||
| --include "_nuxt/manifest.json" \ | ||
| --include "robots.txt" \ | ||
| --include "favicon*" \ | ||
| --include "manifest.json" \ | ||
| --include "site.webmanifest" \ | ||
| --include "browserconfig.xml" \ | ||
| --include "sitemap.xml" \ | ||
| --cache-control "no-cache,max-age=0" | ||
|
|
||
| - name: Delete stale assets from S3 | ||
| shell: bash | ||
| run: | | ||
| aws s3 sync .output/public/ s3://${{ inputs.s3-bucket }}/ --follow-symlinks --delete \ | ||
| --exclude "cf-logs/*" \ | ||
| --exclude "_nuxt/*" \ | ||
| --exclude "*.html" --exclude "*.map" \ | ||
| --exclude "robots.txt" --exclude "favicon*" \ | ||
| --exclude "manifest.json" --exclude "site.webmanifest" \ | ||
| --exclude "browserconfig.xml" --exclude "sitemap.xml" \ | ||
| --cache-control "max-age=2592000,public" \ | ||
| --expires 2034年01月01日T00:00:00Z | ||
| --exclude "*.html" \ | ||
| --exclude "*.map" \ | ||
| --exclude "_payload.json" \ | ||
| --exclude "*/_payload.json" \ | ||
| --exclude "robots.txt" \ | ||
| --exclude "favicon*" \ | ||
| --exclude "manifest.json" \ | ||
| --exclude "site.webmanifest" \ | ||
| --exclude "browserconfig.xml" \ | ||
| --exclude "sitemap.xml" \ | ||
|
Comment on lines
71
to
+83
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stale no-cache artifacts are never removed from S3. The only Use a dedicated 🤖 Prompt for AI Agents |
||
| --cache-control "public,max-age=2592000" | ||
|
|
||
| aws s3 rm s3://${{ inputs.s3-bucket }}/ --recursive \ | ||
| --exclude "*" --include "*.map" | ||
| --exclude "*" \ | ||
| --include "*.map" | ||
|
|
||
| - name: Invalidate CloudFront | ||
| id: invalidate | ||
|
|
||