From 808357eff150e53069aca4166680461a04c0b394 Mon Sep 17 00:00:00 2001 From: wood chen Date: Sun, 9 Mar 2025 10:20:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8C=85=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/push_image.yml | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index c3d16a3c..9a4178d6 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -1,16 +1,19 @@ -name: Docker Image CI (stable versions) +name: Docker on: push: branches: - main +env: + IMAGE_NAME: certimate + jobs: - build-and-push: + build: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 - name: Set up QEMU @@ -19,32 +22,25 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - woodchen/certimate - - - name: Log in to DOCKERHUB + - name: Login to Docker Hub uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and push Docker image - uses: docker/build-push-action@v6 + - name: Build and push + uses: docker/build-push-action@v5 with: context: . - file: ./Dockerfile - platforms: linux/amd64 + file: Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest + platforms: linux/amd64 - name: 部署到服务器 uses: appleboy/ssh-action@master env: - DOCKER_IMAGE: woodchen/certimate:latest + DOCKER_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/certimate:latest PROJECT_PATH: ${{ secrets.PROJECT_PATH }} with: host: ${{ secrets.SERVER_IP }}