From bcf36c19a14d16e5cba0f5e1dacfbfb7f9a1c9de Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Mon, 29 Apr 2024 11:04:16 +0800 Subject: [PATCH 1/5] test docker hub --- .github/workflows/publish-nightly-image.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-nightly-image.yml b/.github/workflows/publish-nightly-image.yml index 13e1c69d06..5af6ee6756 100644 --- a/.github/workflows/publish-nightly-image.yml +++ b/.github/workflows/publish-nightly-image.yml @@ -19,16 +19,17 @@ name: Publish Nightly Docker image on: workflow_dispatch: - schedule: - - cron: '10 20 * * *' + # schedule: + # - cron: '10 20 * * *' env: - REGISTRY: ghcr.io + REGISTRY: docker.io + # REGISTRY: ghcr.io IMAGE_NAME: apache/horaedb-server jobs: docker: - if: github.repository_owner == 'apache' + # if: github.repository_owner == 'apache' runs-on: ubuntu-latest permissions: contents: read @@ -43,7 +44,7 @@ jobs: with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set Environment Variables run: | echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d')" >> $GITHUB_ENV From 6baf6df0445f085dba4c330e12d019104483f2ee Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Mon, 29 Apr 2024 11:15:51 +0800 Subject: [PATCH 2/5] fix username --- .github/workflows/publish-nightly-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-nightly-image.yml b/.github/workflows/publish-nightly-image.yml index 5af6ee6756..d9d629f4fe 100644 --- a/.github/workflows/publish-nightly-image.yml +++ b/.github/workflows/publish-nightly-image.yml @@ -43,7 +43,7 @@ jobs: uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} + username: jiacailiu password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set Environment Variables run: | From a3940ad34aba97cd999e3be069d5dd5c5511cc01 Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Fri, 10 May 2024 15:56:31 +0800 Subject: [PATCH 3/5] fix meta --- .github/workflows/dockerhub-publish.yml | 29 ++++++++++++++++++--- .github/workflows/publish-nightly-image.yml | 4 +-- README.md | 3 ++- horaemeta/Dockerfile | 2 +- 4 files changed, 30 insertions(+), 8 deletions(-) diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/dockerhub-publish.yml index 5efd328efa..17f3cc12f0 100644 --- a/.github/workflows/dockerhub-publish.yml +++ b/.github/workflows/dockerhub-publish.yml @@ -24,8 +24,8 @@ on: - 'v*' jobs: - docker: - if: github.repository_owner == 'FIXME' + horaemeta: + if: github.repository_owner == 'apache' runs-on: ubuntu-latest steps: - name: Checkout @@ -35,11 +35,32 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} + username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and Push HoraeDB Server Docker Image uses: docker/build-push-action@v3 with: context: . push: true - tags: apache/horaemeta-server:latest,horaedb/horaemeta-server:${{github.ref_name}} + file: horaemeta/Dockerfile + tags: apache/horaemeta-server:latest,apache/horaemeta-server:${{github.ref_name}} + + horaedb: + if: github.repository_owner == 'apache' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and Push HoraeDB Server Docker Image + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: apache/horaedb-server:latest,apache/horaedb-server:${{github.ref_name}} diff --git a/.github/workflows/publish-nightly-image.yml b/.github/workflows/publish-nightly-image.yml index d9d629f4fe..d25a68cf21 100644 --- a/.github/workflows/publish-nightly-image.yml +++ b/.github/workflows/publish-nightly-image.yml @@ -29,7 +29,7 @@ env: jobs: docker: - # if: github.repository_owner == 'apache' + if: github.repository_owner == 'apache' runs-on: ubuntu-latest permissions: contents: read @@ -43,7 +43,7 @@ jobs: uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} - username: jiacailiu + username: ${{ secrets.DOCKERHUB_USER }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Set Environment Variables run: | diff --git a/README.md b/README.md index 59fd85c49d..da79ecd418 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ ![License](https://img.shields.io/badge/license-Apache--2.0-green.svg) [![CI](https://github.com/apache/incubator-horaedb/actions/workflows/ci.yml/badge.svg)](https://github.com/apache/incubator-horaedb/actions/workflows/ci.yml) [![OpenIssue](https://img.shields.io/github/issues/apache/incubator-horaedb)](https://github.com/apache/incubator-horaedb/issues) - +[![HoraeDB Docker](https://img.shields.io/docker/v/apache/horaedb-server?logo=docker)](https://hub.docker.com/r/apache/horaedb-server) +[![HoraeMeta Docker](https://img.shields.io/docker/v/apache/horaemeta-server?logo=docker)](https://hub.docker.com/r/apache/horaemeta-server) [中文](./README-CN.md) diff --git a/horaemeta/Dockerfile b/horaemeta/Dockerfile index 9512582af7..df4ebe754e 100644 --- a/horaemeta/Dockerfile +++ b/horaemeta/Dockerfile @@ -24,7 +24,7 @@ USER root RUN apt update && apt install --yes gcc g++ libssl-dev pkg-config cmake && rm -rf /var/lib/apt/lists/* -COPY . /horaemeta +COPY horaemeta /horaemeta WORKDIR /horaemeta RUN make build From ef1fc1ff38d1e2ed3b2e8ec626712a795c7f3f8b Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Fri, 10 May 2024 16:06:45 +0800 Subject: [PATCH 4/5] fix nightly --- .github/workflows/publish-nightly-image.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-nightly-image.yml b/.github/workflows/publish-nightly-image.yml index d25a68cf21..13e1c69d06 100644 --- a/.github/workflows/publish-nightly-image.yml +++ b/.github/workflows/publish-nightly-image.yml @@ -19,12 +19,11 @@ name: Publish Nightly Docker image on: workflow_dispatch: - # schedule: - # - cron: '10 20 * * *' + schedule: + - cron: '10 20 * * *' env: - REGISTRY: docker.io - # REGISTRY: ghcr.io + REGISTRY: ghcr.io IMAGE_NAME: apache/horaedb-server jobs: @@ -43,8 +42,8 @@ jobs: uses: docker/login-action@v2 with: registry: ${{ env.REGISTRY }} - username: ${{ secrets.DOCKERHUB_USER }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Set Environment Variables run: | echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d')" >> $GITHUB_ENV From 08af50f84f59850a6b5c2c4ae76333d9250ad62a Mon Sep 17 00:00:00 2001 From: jiacai2050 Date: Fri, 10 May 2024 16:13:31 +0800 Subject: [PATCH 5/5] add inputs --- .../{dockerhub-publish.yml => publish-image.yml} | 13 ++++++------- ...{docker-build-image.yml => test-build-image.yml} | 0 2 files changed, 6 insertions(+), 7 deletions(-) rename .github/workflows/{dockerhub-publish.yml => publish-image.yml} (92%) rename .github/workflows/{docker-build-image.yml => test-build-image.yml} (100%) diff --git a/.github/workflows/dockerhub-publish.yml b/.github/workflows/publish-image.yml similarity index 92% rename from .github/workflows/dockerhub-publish.yml rename to .github/workflows/publish-image.yml index 17f3cc12f0..fef5606efc 100644 --- a/.github/workflows/dockerhub-publish.yml +++ b/.github/workflows/publish-image.yml @@ -19,13 +19,13 @@ name: Publish Docker image on: workflow_dispatch: - push: - tags: - - 'v*' + inputs: + version: + description: Version to release + required: true jobs: horaemeta: - if: github.repository_owner == 'apache' runs-on: ubuntu-latest steps: - name: Checkout @@ -43,10 +43,9 @@ jobs: context: . push: true file: horaemeta/Dockerfile - tags: apache/horaemeta-server:latest,apache/horaemeta-server:${{github.ref_name}} + tags: apache/horaemeta-server:latest,apache/horaemeta-server:${{ inputs.version }} horaedb: - if: github.repository_owner == 'apache' runs-on: ubuntu-latest steps: - name: Checkout @@ -63,4 +62,4 @@ jobs: with: context: . push: true - tags: apache/horaedb-server:latest,apache/horaedb-server:${{github.ref_name}} + tags: apache/horaedb-server:latest,apache/horaedb-server:${{ inputs.version }} diff --git a/.github/workflows/docker-build-image.yml b/.github/workflows/test-build-image.yml similarity index 100% rename from .github/workflows/docker-build-image.yml rename to .github/workflows/test-build-image.yml