From d191a70fb9d4ba1b5fdafdd865c914a48b915f1c Mon Sep 17 00:00:00 2001 From: leejooy96 Date: Wed, 8 Mar 2023 13:22:46 +0900 Subject: [PATCH] pack: fix workflow build script --- .github/workflows/documents.yml | 64 +++++++++++++++++---------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/.github/workflows/documents.yml b/.github/workflows/documents.yml index 626d356..a675d0e 100644 --- a/.github/workflows/documents.yml +++ b/.github/workflows/documents.yml @@ -10,39 +10,10 @@ on: workflow_dispatch: jobs: - documents: + find-and-replace-index-file: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - working-directory: ./docs - with: - # fetch all commits to get last updated time or other git log info - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v1 - working-directory: ./docs - with: - node-version: '18' - - # cache node_modules - - name: Cache dependencies - uses: actions/cache@v2 - working-directory: ./docs - id: npm-cache - with: - path: | - **/node_modules - key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm- - # install dependencies if the cache did not hit - - name: Install dependencies - if: steps.npm-cache.outputs.cache-hit != 'true' - working-directory: ./docs - run: npm i - # copy and replace string index.md file - name: Copy and replace string index.md file run: cp README.md docs/src/index.md @@ -65,9 +36,40 @@ jobs: replace: "public/vutron-sample.webp" regex: false + build-documentation-pages: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./docs + + steps: + - uses: actions/checkout@v2 + with: + # fetch all commits to get last updated time or other git log info + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: '18' + + # cache node_modules + - name: Cache dependencies + uses: actions/cache@v2 + id: npm-cache + with: + path: | + **/node_modules + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + # install dependencies if the cache did not hit + - name: Install dependencies + if: steps.npm-cache.outputs.cache-hit != 'true' + run: npm i + # run build script - name: Build VitePress site - working-directory: ./docs run: npm run build # please check out the docs of the workflow for more details