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