Skip to content

Commit

Permalink
feat: 测试环境备份
Browse files Browse the repository at this point in the history
  • Loading branch information
devil committed Aug 2, 2024
1 parent ff2586d commit 9ea9282
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,27 @@ jobs:
- name: 打印仓库文件列表 📦
run: ls ${{ github.workspace }}


- name: 打包代码成 ZIP 文件 📦
id: deploy
run: |
zip -r publish.zip . -x "*.git*"
echo "::set-output name=zip-path::publish.zip"
- name: 查看 zip 文件 📦
run: ls

- name: 推送到测试服务器服务器
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
env:
LASTSSH: "Doing something after copying"
with:
host: ${{ secrets.DEV_SERVER_HOST }}
user: ${{ secrets.DEV_SERVER_USER }}
pass: ${{ secrets.DEV_SERVER_PASSWORD }}
scp: |
./publish.zip => /opt/app/zip
last_ssh: |
ls
- name: 推送到备份服务器
uses: cross-the-world/ssh-scp-ssh-pipelines@latest
env:
Expand All @@ -84,9 +100,10 @@ jobs:
user: ${{ secrets.DEV_SERVER_USER }}
pass: ${{ secrets.DEV_SERVER_PASSWORD }}
scp: |
. => /opt/app/zip
./publish.zip => /opt/app/test
last_ssh: |
ls
zip /opt/app/zip/publish.zip
# docker-compose -f /opt/app/zip/docker-compose.env.yml up -d
# docker-compose -f /opt/app/zip/docker-compose.service.yml up -d
# docker-compose ps
Expand Down

0 comments on commit 9ea9282

Please sign in to comment.