Skip to content

Commit

Permalink
Fix S3 cp html cache-control
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Aug 17, 2023
1 parent 6d39a7b commit 10b35bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
- canary
- rename-longport
- build-test
jobs:
deploy_canary:
name: build
Expand Down Expand Up @@ -32,7 +32,5 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.FE_S3_OPEN_STATIC_CANARY_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FE_S3_OPEN_STATIC_CANARY_ACCESS_KEY_SECRET }}
run: |
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/ --exclude "*.map" --cache-control max-age=31536000
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/ --cache-control no-cache
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/en/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/en/ --cache-control no-cache
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/zh-HK/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/zh-HK/ --cache-control no-cache
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/ --exclude "*.map" --exclude "*.html" --exclude "*.xml" --cache-control max-age=31536000
aws --region=${{ secrets.CANARY_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_CANARY_BUCKET }}/openapi-website/ --exclude "*" --include "*.html" --include "*.xml" --cache-control no-cache
13 changes: 5 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
- build-test
jobs:
deploy_release:
name: build
Expand Down Expand Up @@ -31,17 +32,13 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_ACCESS_KEY_SECRET }}
run: |
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/ --exclude "*.map" --cache-control max-age=31536000
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 cp ./dist/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/ --cache-control no-cache
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 cp ./dist/en/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/en/ --cache-control no-cache
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 cp ./dist/zh-HK/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/zh-HK/ --cache-control no-cache
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/ --exclude "*.map" --exclude "*.html" --exclude "*.xml" --cache-control max-age=31536000
aws --region=${{ secrets.PROD_BJ_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_BJ_BUCKET }}/openapi-website/ --exclude "*" --include "*.html" --include "*.xml" --cache-control no-cache
- name: upload dist to hk
env:
AWS_ACCESS_KEY_ID: ${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_ACCESS_KEY_SECRET }}
run: |
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/ --exclude "*.map" --cache-control max-age=31536000
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/ --cache-control no-cache
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/en/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/en/ --cache-control no-cache
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 cp ./dist/zh-HK/docs/index.html s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/zh-HK/ --cache-control no-cache
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/ --exclude "*.map" --exclude "*.html" --exclude "*.xml" --cache-control max-age=31536000
aws --region=${{ secrets.PROD_HK_AWS_DEFAULT_REGION }} s3 sync ./dist s3://${{ secrets.FE_S3_OPEN_STATIC_PROD_HK_BUCKET }}/openapi-website/ --exclude "*" --include "*.html" --include "*.xml" --cache-control no-cache

0 comments on commit 10b35bf

Please sign in to comment.