From af6e0d4d475e5733216d7da05d69235ab2c2618e Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Thu, 2 Mar 2023 14:45:18 +0800 Subject: [PATCH 1/3] fix image name --- .github/workflows/dockerhub-publish-nightly.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dockerhub-publish-nightly.yml b/.github/workflows/dockerhub-publish-nightly.yml index ebf38a5e81..f176b2c4c7 100644 --- a/.github/workflows/dockerhub-publish-nightly.yml +++ b/.github/workflows/dockerhub-publish-nightly.yml @@ -7,10 +7,11 @@ on: env: REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: docker: - if: github.repository_owner == 'CeresDB' + # if: github.repository_owner == 'CeresDB' runs-on: ubuntu-latest permissions: contents: read @@ -29,9 +30,14 @@ jobs: - name: Set Environment Variables run: | echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d')" >> $GITHUB_ENV + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Build and Push CeresDB Server Docker Image uses: docker/build-push-action@v3 with: context: . push: true - tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }} + tags: nightly-${{ env.BUILD_DATE }} From 7fe44a9fa6cd3463475d3284c3d59e0e538a683b Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Thu, 2 Mar 2023 15:00:46 +0800 Subject: [PATCH 2/3] remove meta step --- .github/workflows/dockerhub-publish-nightly.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dockerhub-publish-nightly.yml b/.github/workflows/dockerhub-publish-nightly.yml index f176b2c4c7..bf8c423506 100644 --- a/.github/workflows/dockerhub-publish-nightly.yml +++ b/.github/workflows/dockerhub-publish-nightly.yml @@ -30,14 +30,9 @@ jobs: - name: Set Environment Variables run: | echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d')" >> $GITHUB_ENV - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and Push CeresDB Server Docker Image + - name: Build and Push Docker Image uses: docker/build-push-action@v3 with: context: . push: true - tags: nightly-${{ env.BUILD_DATE }} + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:nightly-${{ env.BUILD_DATE }} From 6f9bfa6f3f1eb2d8e283d514c01b003cc46a15ea Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Thu, 2 Mar 2023 15:40:31 +0800 Subject: [PATCH 3/3] add if --- .github/workflows/dockerhub-publish-nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerhub-publish-nightly.yml b/.github/workflows/dockerhub-publish-nightly.yml index bf8c423506..8a38426181 100644 --- a/.github/workflows/dockerhub-publish-nightly.yml +++ b/.github/workflows/dockerhub-publish-nightly.yml @@ -11,7 +11,7 @@ env: jobs: docker: - # if: github.repository_owner == 'CeresDB' + if: github.repository_owner == 'CeresDB' runs-on: ubuntu-latest permissions: contents: read