From ffc29d9be626771065aec5c142b6c6832c3594d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?colin=20axn=C3=A9r?= <25233464+colin-axner@users.noreply.github.com> Date: Thu, 23 Dec 2021 12:32:50 +0100 Subject: [PATCH] chore: update make build-docs, add docs build checker (#667) * update Makefile, add docs build checker * Update .github/workflows/check-docs.yml Co-authored-by: Marko Co-authored-by: Marko --- .github/workflows/check-docs.yml | 26 ++++++++++++++++++++++++++ Makefile | 4 +++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-docs.yml diff --git a/.github/workflows/check-docs.yml b/.github/workflows/check-docs.yml new file mode 100644 index 00000000000..ef8e500bc18 --- /dev/null +++ b/.github/workflows/check-docs.yml @@ -0,0 +1,26 @@ +name: Check docs build +# This workflow runs when a PR is labeled with `docs` +# This will check if the docs build successfully by running `npm run build` +on: + pull_request: + paths: + - './docs' + +jobs: + check-docs-build: + if: ${{ github.event.label.name == 'docs' }} + + name: Check docs build + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2.3.1 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Install dependencies and build docs 🧱 + run: | + cd docs + npm install + npm run build diff --git a/Makefile b/Makefile index 82c75b862ef..f424693048e 100644 --- a/Makefile +++ b/Makefile @@ -196,11 +196,13 @@ godocs: build-docs: @cd docs && \ while read -r branch path_prefix; do \ - (git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \ + echo "building branch $${branch}" ; \ + (git clean -fdx && git reset --hard && git checkout $${branch} && npm install && VUEPRESS_BASE="/$${path_prefix}/" npm run build) ; \ mkdir -p ~/output/$${path_prefix} ; \ cp -r .vuepress/dist/* ~/output/$${path_prefix}/ ; \ cp ~/output/$${path_prefix}/index.html ~/output ; \ done < versions ; + .PHONY: build-docs ###############################################################################