Skip to content

Commit

Permalink
Update build.vue3.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
wenjianzhang authored Jan 4, 2024
1 parent 986cdb9 commit 7fc35da
Showing 1 changed file with 25 additions and 11 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/build.vue3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,45 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v3
with:
node-version: '16.15.0'
- name: checkout
uses: actions/checkout@v3

- name: install
run: yarn

- name: Build
run: yarn run build
run: yarn build

- name: ClearFile
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似
host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
# 重启的脚本,根据自身情况做相应改动,一般要做的是migrate数据库以及重启服务器
script: |
sudo rm -rf /www/vue3/*
- name: Deploy to Server # 第四步,rsync推送文件
uses: AEnterprise/rsync-deploy@v1.0 # 使用别人包装好的步骤镜像
- name: Deploy to Server # 第四步,rsync推送文件
uses: tohn/rsync-deploy@v1.1.1 # 使用别人包装好的步骤镜像
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥
ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件
SERVER_PORT: '22' # SSH端口
FOLDER: ./dist/* # 要推送的文件夹,路径相对于代码仓库的根目录
SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com)
USERNAME: ${{ secrets.SSH_USERNAME }} # 引用配置,服务器登录名
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} # 引用配置,SSH私钥
ARGS: -avz --delete --exclude='*.pyc' # rsync参数,排除.pyc文件
SERVER_PORT: '22' # SSH端口
FOLDER: ./dist/* # 要推送的文件夹,路径相对于代码仓库的根目录
SERVER_IP: ${{ secrets.SSH_HOST }} # 引用配置,服务器的host名(IP或者域名domain.com)
USERNAME: ${{ secrets.SSH_USERNAME }} # 引用配置,服务器登录名
SERVER_DESTINATION: /www/vue3/ # 部署到目标文件夹

- name: Agent File
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }} # 下面三个配置与上一步类似
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
# 重启的脚本,根据自身情况做相应改动,一般要做的是migrate数据库以及重启服务器
script: |
sudo cp /www/agent/* /www/vue3/

0 comments on commit 7fc35da

Please sign in to comment.