Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support pd-store-server image publishment #9

Merged
merged 8 commits into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/publish_latest_pd_store_server_image.yml
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 }}