pack: fix workflow build script
This commit is contained in:
1 parent
2911597d08
commit
d191a70fb9
1 file changed
+33
-31
@@ -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
|
||||
|
||||
Reference in new issue
Block a user