web/.github/workflows/deploy.yml

32 lines
712 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