Skip to content

Commit

Permalink
fix: workflow pre
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlLiu2023 committed Sep 8, 2023
1 parent f3fd6bc commit fea4fe9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,22 @@ jobs:
aws-region: us-west-2
- name: deploy to s3
run: |
aws s3 cp apps/storefront/dist/assets s3://b3-cdn-files/b2b/production/storefront --recursive --acl public-read
aws s3 cp apps/storefront/dist s3://b3-cdn-files/b2b/production/storefront --recursive --acl public-read
aws cloudfront create-invalidation --distribution-id E1ZCC8QPXD9I6K --path "/*"
- name: create revision
run: |
poly_js=$(find apps/storefront/dist/assets -name polyfills-legacy.*.js -type f -printf '%f')
index_js=$(find apps/storefront/dist/assets -name index-legacy.*.js -type f -printf '%f')
poly_js=$(find apps/storefront/dist -name polyfills-legacy.*.js -type f -printf '%f')
index_js=$(find apps/storefront/dist -name index.*.js ! -path "apps/storefront/dist/assets/*" -type f -printf '%f')
indexLegacy_js=$(find apps/storefront/dist -name index-legacy.*.js ! -path "apps/storefront/dist/assets/*" -type f -printf '%f')
curl --location --request POST '${{ secrets.API_HOST_PRODUCTION }}/api/v3/stores/revisions' \
--header 'Authorization: Basic ${{ secrets.API_CREDENTIAL_PRODUCTION }}' \
--header 'Content-Type: application/json' \
--data-binary @- << EOF
{
"jsFiles": [
"https://cdn.bundleb2b.net/b2b/production/storefront/${poly_js}",
"https://cdn.bundleb2b.net/b2b/production/storefront/${index_js}"
"<script type=\"module\" crossorigin src=\"https://cdn.bundleb2b.net/b2b/production/storefront/${index_js}\"></script>",
"<script nomodule crossorigin src=\"https://cdn.bundleb2b.net/b2b/production/storefront/${poly_js}\"></script>",
"<script nomodule crossorigin src=\"https://cdn.bundleb2b.net/b2b/production/storefront/${indexLegacy_js}\"></script>"
],
"revisionTitle": "${GITHUB_SHA_SHORT}"
}
Expand Down

0 comments on commit fea4fe9

Please sign in to comment.