Skip to content

fix: 修复 v2 ,变量更新时,更新错误 #256

fix: 修复 v2 ,变量更新时,更新错误

fix: 修复 v2 ,变量更新时,更新错误 #256

Workflow file for this run

name: Deploy Site
on:
workflow_dispatch:
push:
branches: [main]
schedule:
# 北京时间凌晨5点
- cron: "0 5 * * *"
jobs:
build-and-deploy:
if: github.repository == 'Aisen60/vant-theme'
runs-on: ubuntu-latest
env:
# 设置时区环境变量
TZ: Asia/Shanghai
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: main
- name: Install node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build project
run: npm run build:gh-pages
- name: Deploy gh page
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.TOKEN_GH_PAGES }}
publish_dir: ./dist