From e06b0b7d5659316adff28603ea6f91bdff7fd6a3 Mon Sep 17 00:00:00 2001 From: Yang Li Date: Tue, 23 Jul 2024 11:13:01 +0800 Subject: [PATCH] ci(deploy): deploy workflows update --- .github/workflows/deploy.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4161551..6fe9d0b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,9 +7,6 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout Branch - uses: actions/checkout@v4 - - name: Setup Docker Buildx uses: docker/setup-buildx-action@v3 @@ -43,8 +40,8 @@ jobs: port: ${{ secrets.SSH_PORT }} envs: IMAGE,CONTAINER script: | - if docker ps -a | grep "$CONTAINER_NAME"; then - docker stop $CONTAINER_NAME && docker rm $CONTAINER_NAME && docker rmi $IMAGE + if docker ps -a | grep "$CONTAINER"; then + docker stop $CONTAINER && docker rm $CONTAINER && docker rmi $IMAGE fi docker pull $IMAGE docker run -d --name $CONTAINER -p 80:80 -p 443:443 -v /data/nginx-certs:/etc/nginx/certs $IMAGE