mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-05 04:40:19 +03:00
chore: fix acript after review
This commit is contained in:
parent
803ed4dac5
commit
21e8d4c1d2
19
.github/workflows/publish.yml
vendored
19
.github/workflows/publish.yml
vendored
|
@ -93,7 +93,7 @@ jobs:
|
|||
- name: Publish to S3
|
||||
run: npm run publish-cdn
|
||||
|
||||
clearing-cache:
|
||||
invalidate-cache:
|
||||
name: Clear cache
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-version, publish-npm, publish-cli-s3, publish-cdn]
|
||||
|
@ -101,13 +101,14 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Clearing cache
|
||||
run: npm run clear-cache
|
||||
- name: Invalidate CloudFront
|
||||
uses: chetan/invalidate-cloudfront-action@v2
|
||||
- name: Configure AWS
|
||||
uses: aws-actions/configure-aws-credentials@v1
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: us-east-1
|
||||
- name: Invalidate cache
|
||||
run: ./scripts/invalidate-cache.sh
|
||||
shell: bash
|
||||
env:
|
||||
PATHS: '/redoc/*'
|
||||
AWS_REGION: 'us-east-1'
|
||||
DISTRIBUTION: ${{ secrets.DISTRIBUTION }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
"compile:cli": "tsc custom.d.ts cli/index.ts --target es6 --module commonjs --types yargs",
|
||||
"build:demo": "webpack --mode=production --config demo/webpack.config.ts",
|
||||
"publish-cdn": "scripts/publish-cdn.sh",
|
||||
"clear-cache": "scripts/clear-cache.sh",
|
||||
"deploy:demo": "aws s3 sync demo/dist s3://production-redoc-demo --acl=public-read",
|
||||
"license-check": "license-checker --production --onlyAllow 'MIT;ISC;Apache-2.0;BSD;BSD-2-Clause;BSD-3-Clause;CC-BY-4.0;Python-2.0' --summary",
|
||||
"docker:build": "docker build -f config/docker/Dockerfile -t redoc .",
|
||||
|
|
6
scripts/clear-cache.sh → scripts/invalidate-cache.sh
Normal file → Executable file
6
scripts/clear-cache.sh → scripts/invalidate-cache.sh
Normal file → Executable file
|
@ -2,7 +2,7 @@
|
|||
|
||||
set -e # exit on error
|
||||
|
||||
echo Clearing cache
|
||||
echo jsdelivr clearing cache
|
||||
curl -i -X POST https://purge.jsdelivr.net/ \
|
||||
-H 'cache-control: no-cache' \
|
||||
-H 'content-type: application/json' \
|
||||
|
@ -15,6 +15,10 @@ curl -i -X POST https://purge.jsdelivr.net/ \
|
|||
}'
|
||||
|
||||
echo
|
||||
echo start invalidate cloudfront
|
||||
|
||||
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/redoc/*"
|
||||
|
||||
echo Cache cleared successfully
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user