Skip to content

Commit

Permalink
🐎 ci: Github Actions工作流
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghui-su committed Jun 17, 2024
1 parent 2af3e9d commit 85e8f84
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 打包应用并上传腾讯云

on:
push:
branches:
- master

jobs:
build:
# runs-on 指定job任务运行所需要的虚拟机环境(必填字段)
runs-on: ubuntu-latest
steps:
# 获取源码
- name: 迁出代码
# 使用action库 actions/checkout获取源码
uses: actions/checkout@master

# 安装Node10
- name: 安装node.js
# 使用action库 actions/setup-node安装node
uses: actions/setup-node@v1
with:
node-version: 18.20.2

# 安装依赖
- name: 安装依赖
run: npm install

# 打包
- name: 打包
run: npm run build

# 上传阿里云
- name: 发布到腾讯云
uses: easingthemes/ssh-deploy@v2.1.1
env:
# 私钥
SSH_PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
# scp参数
ARGS: "-avzr --delete"
# 源目录
SOURCE: "dist"
# 服务器ip:换成你的服务器IP
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
# 用户
REMOTE_USER: "root"
# 目标地址
TARGET: "/www/wwwroot"

0 comments on commit 85e8f84

Please sign in to comment.