Skip to content

Commit

Permalink
✨ feat: 上传github工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyu1998 committed Aug 15, 2024
1 parent 61f5ed7 commit fc93a18
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: 🚀 部署文档

on:
push:
branches:
# 确保这是你正在使用的分支名称
- docs

jobs:
deploy-gh-pages:
name: CI&CD # 此任务(job)的名字
runs-on: ubuntu-latest # 运行环境
steps:
- uses: actions/checkout@master # 切换分支到main
with:
fetch-depth: 2

- name: Use Node.js 18.x
uses: actions/setup-node@v2.1.4 # 使用node环境
with:
node-version: '18.x' # 版本12

# - name: Cache node modules
# id: cache # 缓存id
# uses: actions/cache@v2
# env:
# cache-name: cache-node-modules # 缓存名字
# with:
# path: node_modules # 缓存路径
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package.json') }} # 缓存标识

- name: Install pnpm
run: npm i pnpm -g

- name: Install Dependencies
# if: steps.cache.outputs.cache-hit != 'true' # 如果没有缓存的话
run: pnpm i # 安装依赖

- name: Build Packages
run: pnpm run build # 打包文件

- name: 👷部署文档
uses: JamesIves/github-pages-deploy-action@v4
with:
# 这是文档部署到的分支名称
branch: gh-pages
folder: ./.vitepress/dist
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fc93a18

Please sign in to comment.