Skip to content

Build and Actions #5519

Build and Actions

Build and Actions #5519

Workflow file for this run

name: Build and Actions
# 监听 main 分支的推送
on:
push:
schedule:
- cron: '*/59 * * * *'
jobs:
# job 名
build-and-deploy:
# 运行环境
runs-on: ubuntu-latest
# 运行步骤
steps:
# 获取源码
- name: Checkout
uses: actions/checkout@v2.3.1
# 安装Pnpm
- name: Install Pnpm
run: npm install pnpm -g
# 下载依赖
- name: Install dependencies and Build
run: pnpm install --no-frozen-lockfile
# Docs 安装依赖
- name: Docs Build
run: pnpm docs:build
- name: 创建GithubActionsPages
run: |
echo "拷贝文件开始"
dist_path=packages/docs/docs/.vitepress/dist/
cd $dist_path
date_time=`TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"`
echo "${date_time}" > GithubActionsPages
# 发布
# 发布在 gh-pages 分支,会自动创建
# 将打包后的 dist 目录放到 gh-pages 分支
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.SUPBOSE_VITEPRESS }}
publish_dir: packages/docs/docs/.vitepress/dist/
cname: https://vitepress.panxie.cc