ci(docker): 更新 Docker镜像构建和推送流程

- 添加 Docker Hub 登录步骤
- 更新镜像标签为 latest
- 增加镜像推送步骤
This commit is contained in:
coolxitech 2024-11-09 14:06:36 +08:00
parent 059ec22a31
commit 174c30b0e6

View File

@ -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