imbajin commented on issue #2951:
URL: 
https://github.com/apache/incubator-hugegraph/issues/2951#issuecomment-3904539166

   Example for the image build:
   
   ```yaml
   name: "Publish pd-store-server image(latest)"
   
   on:
     workflow_dispatch:
       inputs:
         mvn_args:
           required: false
           default: ''
           description: 'mvn build args, like "MAVEN_ARGS=-P stage"'
    
   jobs:
     build_latest:
       runs-on: ubuntu-latest
       env:
         REPOSITORY_URL: apache/hugegraph
         BRANCH: master
         PD_IMAGE_URL: hugegraph/pd:latest
         STORE_IMAGE_URL: hugegraph/store:latest
         SERVER_IMAGE_URL: hugegraph/server:latest
         MVN_ARGS: ${{inputs.mvn_args}}
   
       steps:
       # - name: Maximize Build Space
       #   uses: easimon/maximize-build-space@master
       #   with:
       #     root-reserve-mb: 512
       #     swap-size-mb: 1024
       #     remove-dotnet: 'true'
   
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v3
   
       - name: Login to Docker Hub
         uses: docker/login-action@v3
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_PASSWORD }}
   
       - name: Checkout latest
         uses: actions/checkout@v4
         with:
           repository: ${{ env.REPOSITORY_URL }}
           ref: ${{ env.BRANCH }}
           fetch-depth: 2
   
       - name: Build x86 PD Image
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-pd/Dockerfile
           load: true
           tags: ${{ env.PD_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   
       - name: Build x86 Store Image
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-store/Dockerfile
           load: true
           tags: ${{ env.STORE_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   
       - name: Build x86 Server Image
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-server/Dockerfile-hstore
           load: true
           tags: ${{ env.SERVER_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   
       - name: Test x86 Images
         run: |
           docker images
           docker run -itd --name=pd --network host $PD_IMAGE_URL
           sleep 10s
           curl 0.0.0.0:8620 || exit
           docker run -itd --name=store --network host $STORE_IMAGE_URL
           sleep 10s
           curl 0.0.0.0:8520 || exit
           docker run -itd --name=server --network host $SERVER_IMAGE_URL
           sleep 10s
           curl 0.0.0.0:8080 || exit
           docker ps -a
   
       - name: Push x86 & ARM PD Images
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-pd/Dockerfile
           platforms: linux/amd64,linux/arm64
           push: true
           tags: ${{ env.PD_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   
       - name: Push x86 & ARM Store Images
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-store/Dockerfile
           platforms: linux/amd64,linux/arm64
           push: true
           tags: ${{ env.STORE_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   
       - name: Push x86 & ARM Server Images
         uses: docker/build-push-action@v5
         with:
           context: .
           file: ./hugegraph-server/Dockerfile-hstore
           platforms: linux/amd64,linux/arm64
           push: true
           tags: ${{ env.SERVER_IMAGE_URL }}
           # cache-from: type=gha
           # cache-to: type=gha,mode=max
           build-args: ${{ env.MVN_ARGS }}
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to