Skip to content

Commit 023d4ee

Browse files
author
白唯
committed
ci(更改 ci/cd 配置): 更改 CI/CD 配置
1 parent f3eae9f commit 023d4ee

File tree

2 files changed

+35
-15
lines changed

2 files changed

+35
-15
lines changed

.github/workflows/demo

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: GitHub Actions Build and Deploy Project
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build-and-deploy:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@master
12+
13+
- name: Build and Deploy
14+
uses: JamesIves/github-pages-deploy-action@releases/v2
15+
env:
16+
ACCESS_TOKEN: ${{ secrets.MY_DEPLOY_KEY }}
17+
BASE_BRANCH: master # The branch the action should deploy from.
18+
BRANCH: release # The branch the action should deploy to.
19+
FOLDER: dist # The folder the action should deploy.
20+
BUILD_SCRIPT: yarn && yarn build
21+
- name: Deploy
22+
uses: appleboy/ssh-action@master # 使用ssh链接服务器
23+
with: #登录服务器,git 下载 release 分支
24+
host: ${{ secrets.REMOTE_HOST }}
25+
username: ${{ secrets.REMOTE_USER }}
26+
password: ${{ secrets.REMOTE_PASSWORD }}
27+
port: ${{ secrets.REMOTE_PORT }}
28+
script: |
29+
rm -rf /data/www/temp
30+
mkdir /data/www/temp
31+
cd /data/www/temp
32+
git clone -b release https://github.com/ibwei/vue3-ts-base.git
33+
cd /data/www/temp/vue3-ts-base
34+
rm -rf /data/www/vue3/*
35+
mv ./* /data/www/vue3

.github/workflows/deploy-ci.yml

-15
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,3 @@ jobs:
1818
BRANCH: release # The branch the action should deploy to.
1919
FOLDER: dist # The folder the action should deploy.
2020
BUILD_SCRIPT: yarn && yarn build
21-
- name: Deploy
22-
uses: appleboy/ssh-action@master # 使用ssh链接服务器
23-
with: #登录服务器,git 下载 release 分支
24-
host: ${{ secrets.REMOTE_HOST }}
25-
username: ${{ secrets.REMOTE_USER }}
26-
password: ${{ secrets.REMOTE_PASSWORD }}
27-
port: ${{ secrets.REMOTE_PORT }}
28-
script: |
29-
rm -rf /data/www/temp
30-
mkdir /data/www/temp
31-
cd /data/www/temp
32-
git clone -b release https://github.com/ibwei/vue3-base.git
33-
cd /data/www/temp/vue3-base
34-
rm -rf /data/www/vue3/*
35-
mv ./* /data/www/vue3

0 commit comments

Comments
 (0)