Skip to content

feat(style): update #119

feat(style): update

feat(style): update #119

Workflow file for this run

name: deploy
on:
push:
branches: [ master ] # master 分支有 push 时触发
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- README.md
jobs:
deploy:
if: github.repository == 'dompling/boxjs.react'
runs-on: ubuntu-latest
steps:
# 下载源码
# 这一步就是检出你的仓库并下载里面的代码到runner中,actions/checkout@v2是官方自己造的轮子,直接拿来用就行
- name: Checkout
uses: actions/checkout@v2
# 打包构建
- name: Setup Node
uses: actions/setup-node@master
with:
node-version: "16.20.0"
- run: npm install -g yarn # 安装依赖
- name: Cache Node Modules
id: cache
uses: actions/cache@v2
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install # 安装依赖
- name: Build
id: build
run: yarn build # 打包
# 部署到 GitHub pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3 # 使用部署到 GitHub pages 的 action
with:
publish_dir: ./dist # 部署打包后的 dist 目录
github_token: ${{ secrets.DEPLOY }} # secret 名
user_name: ${{ secrets.MY_USER_NAME }}
user_email: ${{ secrets.MY_USER_EMAIL }}
commit_message: 自动部署 # 部署时的 git 提交信息,自由填写