fix: resolve problem with docker build (#1182)

This commit is contained in:
Ihor Karpiuk
2023-07-19 20:31:59 +03:00
committed by GitHub
parent f189684321
commit 857d894c54
2 changed files with 29 additions and 2 deletions

View File

@@ -252,3 +252,30 @@ jobs:
with:
node-version: 18
- run: bash ./__tests__/smoke/run-smoke.sh "yarn add ./redocly-cli-clean.tgz" "yarn" # FIXME: Use actual openapi-core
run-docker-image:
needs: prepare-smoke
runs-on: ubuntu-latest
name: Test Docker Image
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: __tests__/smoke
key: cache-${{ github.run_id }}-${{ github.run_attempt }}
- name: Build docker image
run: docker build -t redocly/cli:latest .
- name: Run docker image
run: |
cd __tests__/smoke/
docker run --rm redocly/cli:latest --version
docker run --rm -v $PWD:/spec redocly/cli:latest lint openapi.yaml
docker run --rm -v $PWD:/spec redocly/cli:latest bundle openapi.yaml --ext json
docker run --rm -v $PWD:/spec redocly/cli:latest build-docs openapi.yaml
# Check for broken styles (related issue: https://github.com/Redocly/redocly-cli/issues/1073)
if [[ "$(wc -l redoc-static.html)" == "317 redoc-static.html" ]]; then
echo "Docs built correctly."
else
echo "Docs built incorrectly. Received lines: $(wc -l redoc-static.html) (expected 317 lines in redoc-static.html)."
exit 1
fi

View File

@@ -13,9 +13,9 @@
"engineStrict": true,
"scripts": {
"compile": "tsc",
"copy-assets": "cp src/commands/preview-docs/preview-server/default.hbs lib/commands/preview-docs/preview-server/default.hbs && cp src/commands/preview-docs/preview-server/hot.js lib/commands/preview-docs/preview-server/hot.js && cp src/commands/preview-docs/preview-server/oauth2-redirect.html lib/commands/preview-docs/preview-server/oauth2-redirect.html && cp src/commands/build-docs/template.hbs lib/commands/build-docs/template.hbs && cp ../../README.md .",
"copy-assets": "cp src/commands/preview-docs/preview-server/default.hbs lib/commands/preview-docs/preview-server/default.hbs && cp src/commands/preview-docs/preview-server/hot.js lib/commands/preview-docs/preview-server/hot.js && cp src/commands/preview-docs/preview-server/oauth2-redirect.html lib/commands/preview-docs/preview-server/oauth2-redirect.html && cp src/commands/build-docs/template.hbs lib/commands/build-docs/template.hbs ",
"prepack": "npm run copy-assets",
"prepublishOnly": "npm run copy-assets"
"prepublishOnly": "npm run copy-assets && cp ../../README.md ."
},
"repository": {
"type": "git",