Skip to content

chore: Update e2e-test.yml #1354

chore: Update e2e-test.yml

chore: Update e2e-test.yml #1354

Workflow file for this run

# 构建vuepress,并提交到pages分支
name: Docs
on:
pull_request:
branches:
- "master"
push:
branches:
- "master"
jobs:
docs-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run markdown linter
uses: nosborn/[email protected]
with:
files: website/docs,README.md,pkg
config_file: ".github/markdown_lint_config.json"
docs-build-and-deploy:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: docs-lint
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
# 首先生成拉取node文件
- name: Node install
uses: actions/setup-node@v3
with:
node-version: "16.x"
# 缓存 node_modules
- name: Cache dependencies
uses: actions/cache@v3
id: npm-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-npm-cache
restore-keys: |
${{ runner.os }}-npm-
# 如果缓存没有命中,安装依赖
- name: Install dependencies
if: steps.npm-cache.outputs.cache-hit != 'true'
run: cd website && npm install vuepress
# 运行构建脚本
- name: Build VuePress site
run: cd website && npm run docs:build
# 提交
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: pages
folder: ./website/docs/.vuepress/dist