feat: 切换会原deploy配置
parent
02dd664cde
commit
8a72689fb5
|
|
@ -1,19 +1,31 @@
|
||||||
|
# 工作流名称,可自定义
|
||||||
|
name: 自动部署
|
||||||
|
# 事件监听,决定什么时候触发该工作流内的任务
|
||||||
on:
|
on:
|
||||||
|
# 在master分支推动到github时触发
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [ master ]
|
||||||
|
# 任务集合,可包含多个任务
|
||||||
jobs:
|
jobs:
|
||||||
|
# 任务名称
|
||||||
build:
|
build:
|
||||||
|
# 运行的操作系统
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
# 步骤集合,可包含多个步骤
|
||||||
steps:
|
steps:
|
||||||
- name: checkout
|
# 单个步骤,没有名称,直接使用一个action
|
||||||
uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: build
|
# 单个步骤,带有名称,带有参数
|
||||||
|
- name: build and deploy
|
||||||
run: |
|
run: |
|
||||||
corepack enable
|
npm install
|
||||||
pnpm install
|
npm run build
|
||||||
pnpm build
|
cd dist
|
||||||
- name: deploy
|
git config --global user.name "juetan"
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
git config --global user.email "810335188@qq.com"
|
||||||
with:
|
git init
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
git add -A
|
||||||
publish_dir: ./dist
|
git commit -m "Build through github action"
|
||||||
|
git push -f "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:gh-pages
|
||||||
Loading…
Reference in New Issue