Skip to content

Commit

Permalink
fix: s3 upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kcwww committed Apr 21, 2024
1 parent 98cca8d commit c56594d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CDN_Front_Deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
env:
BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
run: |
aws s3 sync ./front/dist s3://$BUCKET_NAME --delete
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.js.gz' --content-encoding 'gzip' --content-type 'application/javascript'
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.svg.gz' --content-encoding 'gzip' --content-type 'image/svg+xml'
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.ico.gz' --content-encoding 'gzip' --content-type 'image/x-icon'
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.ttf.gz' --content-encoding 'gzip' --content-type 'font/ttf'
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.woff.gz' --content-encoding 'gzip' --content-type 'font/woff'
aws s3 sync ./front/dist s3://$BUCKET_NAME --exclude '*' --include '*.mp3.gz' --content-encoding 'gzip' --content-type 'audio/mpeg'
- name: CloudFront Invalidation
env:
CLOUD_FRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID}}
Expand Down
15 changes: 9 additions & 6 deletions front/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vite';
import mkcert from 'vite-plugin-mkcert';
import { compression } from 'vite-plugin-compression2';

import mkcert from 'vite-plugin-mkcert';

export default defineConfig({
plugins: [react(), mkcert(), compression({
include : /\.(js|svg|ico|ttf|mp3)$/i,
threshold: 1400,
})],
plugins: [
react(),
mkcert(),
compression({
include: /\.(js|svg|ico|ttf|woff|mp3)$/i,
threshold: 1400
})
],
server: {
host: '0.0.0.0',
https: true,
Expand Down

0 comments on commit c56594d

Please sign in to comment.