From d0662683f99e63ae0666716e56ded8246c4a35c0 Mon Sep 17 00:00:00 2001 From: zhayujie Date: Mon, 26 Jun 2023 01:20:04 +0800 Subject: [PATCH] feat: publish to dockerhub in github CI simultaneously --- .github/workflows/deploy-image.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml index d9f829e..c3c8439 100644 --- a/.github/workflows/deploy-image.yml +++ b/.github/workflows/deploy-image.yml @@ -28,6 +28,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Log in to the Container registry uses: docker/login-action@v2 with: @@ -39,7 +45,9 @@ jobs: id: meta uses: docker/metadata-action@v4 with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + images: | + ${{ env.IMAGE_NAME }} + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and push Docker image uses: docker/build-push-action@v3