Skip to content

feat(blog): refine webrtc article #26

feat(blog): refine webrtc article

feat(blog): refine webrtc article #26

Workflow file for this run

name: github pages
on:
push:
branches: [master]
# 执行的一项或多项任务
jobs:
build-and-deploy:
# 运行在虚拟机环境ubuntu-latest
# https://docs.github.com/zh/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
runs-on: ubuntu-latest
steps:
- name: 获取源码 🛎️
uses: actions/checkout@v3
with:
lfs: true
submodules: true
# 如果需要递归检出子模块,可以添加以下步骤
- name: 获取子项目源码 🏆
run: git submodule update --init --recursive
- name: Node环境版本 🗜️
uses: actions/setup-node@v3
with:
node-version: 18
- name: Yarn缓存 📁
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: 缓存依赖 📚
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: 安装依赖 📦
run: yarn install --frozen-lockfile
- name: 安装 Hexo 🦊
run: npm install -g hexo-cli
- name: 打包 🏗️
run: yarn build && touch ./public/.nojekyll # run: touch ./out/.nojekyll是因为由于 Jekyll 处理,GitHub 默认不提供_next文件夹,.nojekyll文件阻止了这种情况,
- name: 同步 🦞
env:
NEXT_GITHUB_BACKEND_TOKEN: ${{ secrets.BACKEND_TOKEN }}
run: yarn sync
- name: 部署 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # 部署后提交到那个分支
folder: public # 这里填打包好的目录名称
clean: true