pack: fix workflow build script

This commit is contained in:
leejooy96 committed 2023-03-08 13:22:46 +09:00
1 parent 2911597d08
commit d191a70fb9
1 file changed
+33 -31
+33 -31
View File
@@ -10,39 +10,10 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
documents: find-and-replace-index-file:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: 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 # copy and replace string index.md file
- name: Copy and replace string index.md file - name: Copy and replace string index.md file
run: cp README.md docs/src/index.md run: cp README.md docs/src/index.md
@@ -65,9 +36,40 @@ jobs:
replace: "public/vutron-sample.webp" replace: "public/vutron-sample.webp"
regex: false 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 # run build script
- name: Build VitePress site - name: Build VitePress site
working-directory: ./docs
run: npm run build run: npm run build
# please check out the docs of the workflow for more details # please check out the docs of the workflow for more details