-
Notifications
You must be signed in to change notification settings - Fork 3
95 lines (82 loc) · 2.83 KB
/
vue.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Release Vue
on:
push:
branches: ["tenant"]
tags:
- 'v*' # 推送标签,比如 v1.0, v20.15.10
# on:
# push:
# paths:
# - "admin/**"
# pull_request:
# branches: ["tenant"]
# paths:
# - "admin/**"
env:
TZ: Asia/Shanghai
jobs:
build: # 声明job的名字
runs-on: ubuntu-20.04 # 使用ubuntu系统镜像运行脚本
# steps定义job的步骤,具体执行,运行xxx,-字符开头的一块则为一个步骤,可以配置多个步骤
steps:
- uses: actions/checkout@v4 # 下载git仓库中的代码,使用官方提供,使用库用uses关键字
with:
clean: false
- name: Install Node.js # 下载指定的 Node 版本
uses: actions/setup-node@v4
with:
node-version: 18.20.2
- name: Install pnpm # 下载 pnpm 包
uses: pnpm/action-setup@v3
with:
version: 9.4.0
- name: Build Vue # 编译前端代码
run: |
cd admin
pnpm i
pnpm build:pro
- name: Generate Build Artifacts # 打包编译文件
uses: actions/upload-artifact@v4
with:
name: compiled
path: |
admin/dist/
vue:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4 # 下载git仓库中的代码,使用官方提供,使用库用uses关键字
with:
clean: false
- name: Clean Vue
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script_stop: true
script: |
rm -rf /data/wwwroot/apollo/admin/*
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: compiled
path: ./compiled
- name: Ftp Vue
uses: sand4rt/ftp-deployer@v1.8
with:
sftp: false # optional
host: ${{ secrets.HOST }} # e.g. ftp.host.com or sftp.host.com (without ftp:// or ftps://)
port: 21 # optional, default is: 21
username: ${{ secrets.FTP_USERNAME }} # FTP username
password: ${{ secrets.FTP_PASSWORD }} # FTP password
remote_folder: apollo/admin # optional, remote path of your FTP server
local_folder: ./compiled # optional, local path, default is: dist
cleanup: false # optional, remove existing files inside FTP remote folder
# include: '[]' # optional, e.g. '['dist']'
# exclude: '[]' # optional, e.g. '['node_modules/**', '.git/**', '*.env']'
passive: true # optional
needs:
- build