Skip to content

Update autobuild.yml #3

Update autobuild.yml

Update autobuild.yml #3

Workflow file for this run

name: Deploy Vue App
on:
push:
branches:
- main # 监听 main 分支的提交
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # 确保 git 历史被完整获取,以便用于版本推送
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Commit docs directory
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -f docs
git commit -m "Deploy new documentation" -a || echo "No changes to commit"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # 推送到 gh-pages 分支
force: true