docs(update): 📃 #76
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
name: ci | |
on: | |
# 每当 push 到 main 分支时触发部署 | |
push: | |
branches: [master] | |
# 手动触发部署 | |
workflow_dispatch: | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
HEXO_ALGOLIA_INDEXING_KEY: 7e2b35b929876e054ae115f1aae550bf | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
# 选择要使用的 node 版本 | |
node-version: "18" | |
# 安装依赖 | |
- name: Install dependencies | |
if: steps.yarn-cache.outputs.cache-hit != 'true' | |
run: yarn --frozen-lockfile | |
- name: install algolia | |
run: yarn add algolia | |
- name: Build frontend | |
run: yarn build | |
- name: Get Algolia | |
run: yarn algolia | |
- name: Deploy to GitHub Pages | |
uses: crazy-max/ghaction-github-pages@v3 | |
with: | |
target_branch: gh-pages | |
build_dir: ./public | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |