From 6b764e192f05886ccd8c1f19ad78dc3e6182fa92 Mon Sep 17 00:00:00 2001 From: Vladislav Tupikin Date: Thu, 5 Oct 2023 13:36:26 +0300 Subject: [PATCH] publish.yml auto docs upload added --- .github/workflows/publish.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index daa9dc889..a1c199934 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,3 +64,41 @@ jobs: run: npm publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-docs: + name: Docs publish + runs-on: self-hosted + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: master + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: npm ci + + - name: Generate docs + run: npm run doc + + - name: Checkout docs branch + uses: actions/checkout@v4 + with: + ref: docs + clean: false + + - name: Copy docs to root + run: | + cp -r docs/* . + + - name: Commit and push docs + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add . + git commit -m "Update documentation" + git push