From d7532b4c458dbef88786b902a8ac93bb99f9eda2 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sun, 9 Mar 2025 09:51:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push_image.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index c5032b7b..76f73055 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -24,7 +24,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - woodchen/certimate + woodchen/certimate:latest - name: Log in to DOCKERHUB uses: docker/login-action@v3 @@ -37,6 +37,22 @@ jobs: with: context: . file: ./Dockerfile - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64 push: true tags: ${{ steps.meta.outputs.tags }} + + - name: 部署到服务器 + uses: appleboy/ssh-action@master + env: + DOCKER_IMAGE: woodchen/certimate:latest + PROJECT_PATH: ${{ secrets.PROJECT_PATH }} + with: + host: ${{ secrets.SERVER_IP }} + username: root + key: ${{ secrets.SERVER_SSH_KEY }} + envs: DOCKER_IMAGE,PROJECT_PATH + script: | + docker pull $DOCKER_IMAGE + cd $PROJECT_PATH + docker compose down + docker compose up -d