-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
643c1e2
commit 8e82ab3
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |