Skip to content

build: 修改脚本

build: 修改脚本 #1

Workflow file for this run

name: Deploy Site
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build-and-deploy:
if: github.repository == 'Aisen60/vue3-h5-template'
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
- 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