From 174c30b0e65053e06b698bddf840bb6f01abb880 Mon Sep 17 00:00:00 2001 From: coolxitech Date: Sat, 9 Nov 2024 14:06:36 +0800 Subject: [PATCH] =?UTF-8?q?ci(docker):=20=E6=9B=B4=E6=96=B0=20Docker?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E6=9E=84=E5=BB=BA=E5=92=8C=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 Docker Hub 登录步骤 - 更新镜像标签为 latest - 增加镜像推送步骤 --- .github/workflows/docker-image.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 140c9f6..6e54c69 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,12 +7,17 @@ on: branches: [ "main" ] jobs: - build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build the Docker image - run: docker build . --file Dockerfile --tag kpxyyyy/dnsmgr:$(date +%s) + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + + - name: Build the Docker image + run: docker build . --file Dockerfile --tag kpxyyyy/dnsmgr:latest + + - name: Push the Docker image + run: docker push kpxyyyy/dnsmgr:latest