fix🐛: 诸多 bug #20
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
# 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 |