Skip to content

Commit

Permalink
chore: auto deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
shellingfordly committed Jun 20, 2024
1 parent 643c1e2 commit 8e82ab3
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: note build
# 触发workflow的条件
on:
push:
# 只有master分支发生push事件时,才会触发workflow
branches:
- main
paths-ignore: # 下列文件的变更不触发部署,可以自行添加
- README.md
- LICENSE
pull_request:
branches: [main]

# jobs表示执行的一项或多项任务
jobs:
deploy: # 任务的job_id,具体名称自定义,这里build代表打包
runs-on: ubuntu-latest # runs-on字段指定运行所需要的虚拟机环境。注意:这个是必填字段
steps:
# 切换分支
# - name: Checkout
# uses: actions/checkout@main

# git submodule
- uses: actions/checkout@v2

# node
- name: use Node.js 16
uses: actions/setup-node@v1
with:
node-version: 16

# npm install
- name: npm install and build
run: |
npm install
npm run build
env:
CI: true

- name: deploy to server
uses: AEnterprise/rsync-deploy@v1.0.2
env:
DEPLOY_KEY: ${{ secrets.ACCESS_TOKEN }}
ARGS: "-e -c -r --delete"
SERVER_PORT: "22"
FOLDER: "./dist"
SERVER_IP: ${{ secrets.SERVER_HOST }}
USERNAME: ${{ secrets.USER_NAME }}
SERVER_DESTINATION: ${{ secrets.TARGET_MYTOOLS }}

0 comments on commit 8e82ab3

Please sign in to comment.