-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support pd-store-server image publishment (#9)
- Loading branch information
Showing
1 changed file
with
120 additions
and
0 deletions.
There are no files selected for viewing
120 changes: 120 additions & 0 deletions
120
.github/workflows/publish_latest_pd_store_server_image.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
name: "Publish pd-store-server image(latest)" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
mvn_args: | ||
required: false | ||
default: 'MAVEN_ARGS=-P stage' | ||
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: 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 | ||
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 | ||
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 }} |