添加部署

This commit is contained in:
wood chen 2025-03-09 09:51:17 +08:00
parent 5ade08bc9d
commit d7532b4c45

View File

@ -24,7 +24,7 @@ jobs:
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: | images: |
woodchen/certimate woodchen/certimate:latest
- name: Log in to DOCKERHUB - name: Log in to DOCKERHUB
uses: docker/login-action@v3 uses: docker/login-action@v3
@ -37,6 +37,22 @@ jobs:
with: with:
context: . context: .
file: ./Dockerfile file: ./Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} 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