|
25 | 25 | steps: |
26 | 26 | - uses: actions/checkout@v4 |
27 | 27 | with: |
28 | | - fetch-depth: 0 |
| 28 | + fetch-depth: 1 |
29 | 29 | - uses: actions/setup-node@v4 |
30 | 30 | with: |
31 | 31 | node-version: 18 |
@@ -65,25 +65,36 @@ jobs: |
65 | 65 | - run: npm install |
66 | 66 | - run: npm run build |
67 | 67 |
|
| 68 | + - name: Clean up node_modules |
| 69 | + run: rm -rf node_modules |
| 70 | + |
68 | 71 | - name: Configure AWS credentials from Staging account |
69 | 72 | uses: aws-actions/configure-aws-credentials@v4 |
70 | 73 | with: |
71 | 74 | role-to-assume: ${{ secrets.STAGING_IAM_ROLE }} |
72 | 75 | aws-region: us-east-1 |
73 | 76 |
|
| 77 | + # - name: Sync all cacheable assets |
| 78 | + # run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
| 79 | + |
| 80 | + # - name: Sync all non-cacheable assets |
| 81 | + # # Don't cache any HTML or JSON file: they should always be up-to-dates |
| 82 | + # run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
| 83 | + |
| 84 | + # - name: Sync PDF |
| 85 | + # run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
| 86 | + |
| 87 | + # - name: Purge cache on CloudFlare |
| 88 | + # run: | |
| 89 | + # curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \ |
| 90 | + # -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \ |
| 91 | + # -H "Content-Type: application/json" \ |
| 92 | + # --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}' |
| 93 | + |
74 | 94 | - name: Sync all cacheable assets |
75 | | - run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
| 95 | + run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
76 | 96 |
|
77 | 97 | - name: Sync all non-cacheable assets |
78 | 98 | # Don't cache any HTML or JSON file: they should always be up-to-dates |
79 | | - run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
80 | | - |
81 | | - - name: Sync PDF |
82 | | - run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
| 99 | + run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/ |
83 | 100 |
|
84 | | - - name: Purge cache on CloudFlare |
85 | | - run: | |
86 | | - curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \ |
87 | | - -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \ |
88 | | - -H "Content-Type: application/json" \ |
89 | | - --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}' |
|
0 commit comments