-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
1 changed file
with
52 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,52 @@ | ||
# action的名称 | ||
name: img.ucalendar.cn | ||
# 运行器 的名称 | ||
run-name: img.ucalendar.cn | ||
# 监听指定分支的push和pull_request事件 | ||
on: | ||
push: | ||
tags: | ||
- v1.* | ||
jobs: | ||
# 运行的任务 test | ||
test: | ||
runs-on: ubuntu-latest # 任务运行在最新的操作平台 | ||
strategy: | ||
matrix: | ||
node-version: [ 18.x ] # 通过指定多个版本,从而对多个版本都进行测试 | ||
steps: | ||
- uses: actions/checkout@v3 # checkout的妙用 https://github.com/actions/checkout | ||
- uses: actions/setup-node@v3 # 使用 setup-node v3 版本来安装指定的nodejs | ||
with: | ||
node-version: ${{ matrix.node-version }} # 这里可以指定特定版本,也可以引用变量 | ||
- run: npm install # 执行命令 | ||
- run: npm run test # 执行命令 | ||
# 运行的任务 build_deploy | ||
build_deploy: | ||
runs-on: ubuntu-latest # 任务运行在最新的操作平台 | ||
strategy: | ||
matrix: | ||
node-version: [ 18.x ] # 通过指定多个版本,从而对多个版本都进行测试 | ||
steps: | ||
- uses: actions/checkout@v3 # checkout的妙用 https://github.com/actions/checkout | ||
- uses: actions/setup-node@v3 # 使用 setup-node v3 版本来安装指定的nodejs | ||
with: | ||
node-version: ${{ matrix.node-version }} # 这里可以指定特定版本,也可以引用变量 | ||
- run: npm install # 执行命令 | ||
- run: npm run build # 执行命令 | ||
name: '部署' | ||
- uses: cross-the-world/scp-pipeline@master | ||
env: | ||
WELCOME: "ssh scp ssh pipelines" | ||
LASTSSH: "Doing something after copying" | ||
with: | ||
host: ${{ secrets.USER_HOST }} | ||
user: ${{ secrets.USER_NAME }} | ||
pass: ${{ secrets.USER_PASS }} | ||
connect_timeout: 10s | ||
local: './dist/*' | ||
remote: /usr/local/nginx/img | ||
|
||
|
||
|
||
|