From cc871a8c7ed3f9ce2714cfc9f9ef9d1341a2aba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 29 Mar 2024 17:46:58 +0200 Subject: [PATCH] Sketch update docs. --- .github/workflows/update-docs.yml | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/update-docs.yml diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml new file mode 100644 index 000000000..4700f58ec --- /dev/null +++ b/.github/workflows/update-docs.yml @@ -0,0 +1,36 @@ +name: Update docs + +on: + pull_request: + branches: [main] + +permissions: + contents: write + +jobs: + update-docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/checkout@v4 + with: + ref: "gh-pages" + repository: ${{ github.event.pull_request.head.repo.full_name }} + path: "docs" + + - uses: actions/setup-node@v4 + with: + node-version: 18 + registry-url: https://registry.npmjs.org/ + + - name: Create release + run: | + npm ci + npm run api:extract + MAJOR_VERSION=v$(node -p "require('./package.json').version.split('.')[0]") + DOCS_OUTPUT_FOLDER=${GITHUB_WORKSPACE}/docs/${MAJOR_VERSION} + + mkdir -p $DOCS_OUTPUT_FOLDER + + npm run api:document