feat: add ai ollama 快速开始 #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# workflow的名称 | |
name: CI | |
# 触发workflow的条件 | |
on: | |
push: # 当master分支有push的时候触发workflow | |
branches: ['master'] | |
# 任务 | |
jobs: | |
build_and_deploy: # 任务Id | |
# 指定运行所需要的虚拟机环境 | |
runs-on: ubuntu-latest | |
# 步骤 | |
steps: | |
# workflow的runner 获取源码 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# 安装node | |
- name: Setup Node.js environment | |
uses: actions/[email protected] | |
with: | |
node-version: '18.x' | |
# https://github.com/pnpm/action-setup 安装pnpm,并做依赖缓存 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
name: Setup pnpm cache | |
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 | |
run: | | |
echo "The MQTT_EMQX_PASSWORD is $MQTT_EMQX_PASSWORD" && | |
pnpm run docs:build | |
env: | |
MQTT_EMQX_PASSWORD: ${{secrets.MQTT_EMQX_PASSWORD}} | |
MQTT_EMQX_USERNAME: ${{secrets.MQTT_EMQX_USERNAME}} | |
# https://github.com/peaceiris/actions-gh-pages 部署到分支 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: doc/.vitepress/dist |