@@ -62,43 +62,39 @@ jobs:
6262 aws-region : ${{ env.AWS_REGION }}
6363
6464 - name : Deploy to S3 with optimized settings
65- env :
66- S3_BUCKET_NAME : ${{ secrets.S3_BUCKET_NAME }}
6765 run : |
6866 # HTML 파일 업로드 - 캐시 비활성화
69- aws s3 sync ${{ env.BUILD_DIR }} s3://$S3_BUCKET_NAME \
67+ aws s3 sync ${{ env.BUILD_DIR }} s3://${{ secrets. S3_BUCKET_NAME }} \
7068 --exclude "*" \
7169 --include "*.html" \
7270 --cache-control "max-age=0,must-revalidate,public" \
7371 --content-type "text/html; charset=utf-8" \
7472 --delete
7573
7674 # CSS 파일 업로드 - 1년 캐시
77- aws s3 sync ${{ env.BUILD_DIR }} s3://$S3_BUCKET_NAME \
75+ aws s3 sync ${{ env.BUILD_DIR }} s3://${{ secrets. S3_BUCKET_NAME }} \
7876 --exclude "*" \
7977 --include "*.css" \
8078 --cache-control "max-age=31536000,public" \
8179 --content-type "text/css; charset=utf-8"
8280
8381 # JS 파일 업로드 - 1년 캐시
84- aws s3 sync ${{ env.BUILD_DIR }} s3://$S3_BUCKET_NAME \
82+ aws s3 sync ${{ env.BUILD_DIR }} s3://${{ secrets. S3_BUCKET_NAME }} \
8583 --exclude "*" \
8684 --include "*.js" \
8785 --cache-control "max-age=31536000,public" \
8886 --content-type "application/javascript; charset=utf-8"
8987
9088 # 기타 파일들 (이미지, 폰트 등) 업로드 - 1년 캐시
91- aws s3 sync ${{ env.BUILD_DIR }} s3://$S3_BUCKET_NAME \
89+ aws s3 sync ${{ env.BUILD_DIR }} s3://${{ secrets. S3_BUCKET_NAME }} \
9290 --exclude "*.html" \
9391 --exclude "*.css" \
9492 --exclude "*.js" \
9593 --cache-control "max-age=31536000,public"
9694
9795 - name : Invalidate CloudFront
98- if : ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID != '' }}
99- env :
100- CLOUDFRONT_DISTRIBUTION_ID : ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
96+ if : secrets.CLOUDFRONT_DISTRIBUTION_ID
10197 run : |
10298 aws cloudfront create-invalidation \
103- --distribution-id $CLOUDFRONT_DISTRIBUTION_ID \
99+ --distribution-id ${{ secrets. CLOUDFRONT_DISTRIBUTION_ID }} \
104100 --paths "/*.html" "/*.css" "/*.js"
0 commit comments