mirror of
https://github.com/Powerful-517/yys-editor.git
synced 2025-08-23 08:04:50 +00:00
23
.github/workflows/deploy.yml
vendored
23
.github/workflows/deploy.yml
vendored
@@ -2,7 +2,7 @@ name: Deploy to Production
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
@@ -22,15 +22,26 @@ jobs:
|
|||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
|
|
||||||
- name: Deploy to server via SSH
|
- name: Deploy to temporary directory
|
||||||
uses: appleboy/scp-action@v1.0.0
|
uses: appleboy/scp-action@v0.1.6
|
||||||
with:
|
with:
|
||||||
host: ${{ secrets.SERVER_HOST }}
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
username: ${{ secrets.SERVER_USERNAME }}
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
port: ${{ secrets.SERVER_PORT || 22 }}
|
port: ${{ secrets.SERVER_PORT || 22 }}
|
||||||
source: "dist/*"
|
source: "dist/*"
|
||||||
target: "/var/www/html/yys-editor"
|
target: "~/code/yys-editor"
|
||||||
rm: true
|
rm: true
|
||||||
debug: true
|
|
||||||
capture_stdout: true
|
- name: Copy to production directory
|
||||||
|
uses: appleboy/ssh-action@v0.1.8
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SERVER_HOST }}
|
||||||
|
username: ${{ secrets.SERVER_USERNAME }}
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
port: ${{ secrets.SERVER_PORT || 22 }}
|
||||||
|
script: |
|
||||||
|
# 清空目标目录
|
||||||
|
sudo rm -rf /var/www/html/yys-editor
|
||||||
|
# 复制文件到目标目录
|
||||||
|
sudo cp -rf /home/ubuntu/code/yys-editor /var/www/html/
|
||||||
|
Reference in New Issue
Block a user