远程部署
All checks were successful
部署到腾讯云 / build-and-push (push) Successful in 2s

This commit is contained in:
CN-P5 2025-04-23 21:18:55 +08:00
parent 6f2a8150ca
commit 588a28fcbb

View File

@ -1,4 +1,4 @@
name: 编译部署
name: 部署到腾讯云
on:
push:
branches:
@ -12,23 +12,21 @@ jobs:
MYIMAGE : ${{ vars.MYIMAGE }}
MYPORT: ${{ vars.MYPORT }}
steps:
- name: 检出源码
uses: https://git.des8.com/docker/checkout@v4
- name: Docker Buildx
uses: https://git.des8.com/docker/setup-buildx-action@v3
- name: 远程部署
uses: https://git.des8.com/docker/ssh-action@v1.0.0
with:
config-inline: |
[registry."git.des8.com"]
http = true
insecure = true
- name: 编译Docker镜像
uses: https://git.des8.com/docker/build-push-action@v5
with:
push: false
tags: $MYREGISTRY/$MYIMAGE
- name: 运行
run: |
docker run -d -p 3000:$MYPORT -v $(pwd):/docs --name $MYIMAGE $MYREGISTRY/$MYIMAGE
host: 122.51.147.115
port: 8022
username: root
key: ${{ secrets.KEY }}
script: |
cd /www/wwwroot/doc-live.des8.com
git clean -f
git remote rm origin
git remote add origin git@git.des8.com:weixiu/ai-live.git
git fetch --all
git reset --hard origin/main
git pull origin main
rm -rf /www/wwwroot/mei.des8.com/.gitea
chown -R www:www ./
pwd && ls -l