40 lines
1006 B
YAML
40 lines
1006 B
YAML
name: 自动部署
|
||
|
||
on:
|
||
push:
|
||
branches: [ master ]
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
|
||
permissions:
|
||
contents: write
|
||
|
||
steps:
|
||
- name: 克隆代码
|
||
uses: actions/checkout@v2
|
||
|
||
- name: 构建产物
|
||
run: |
|
||
npm install
|
||
npm run build
|
||
|
||
- name: 部署分支
|
||
run: |
|
||
cd dist
|
||
git config --global user.name "juetan"
|
||
git config --global user.email "810335188@qq.com"
|
||
git init
|
||
git add -A
|
||
git commit -m "Build through github action"
|
||
git push -f "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:gh-pages
|
||
|
||
- name: 推送到企微
|
||
uses: appnify/action-wechat-work@master
|
||
env:
|
||
WECHAT_WORK_BOT_WEBHOOK: ${{secrets.WECHAT_WORK_BOT_WEBHOOK}}
|
||
with:
|
||
msgtype: text
|
||
content: "推送通知\n\n已有提交推送到仓库,请关注构建结果。"
|