Skip to content

Deploy Site

Deploy Site #270

Workflow file for this run

name: Deploy Site
on:
workflow_dispatch:
push:
branches: [main]
paths-ignore:
- "**.md"
- ".vscode/**"
- ".env*"
- ".eslint*"
- "tsconfig*"
schedule:
# 北京时间凌晨5点
- cron: "0 21 * * *"
jobs:
build-and-deploy:
if: github.repository == 'Aisen60/vant-theme'
runs-on: ubuntu-latest
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