-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
807f1b4
commit 98e2a33
Showing
5 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
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,23 @@ | ||
name: Build & Push StarRocks CN Image to GHCR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
|
||
jobs: | ||
trigger-build-push: | ||
uses: ./.github/workflows/build_push_node_images.yaml | ||
with: | ||
node_name: cn | ||
docker_file: './DockerFile_ComputeNode' | ||
secrets: inherit |
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,23 @@ | ||
name: Build & Push StarRocks FE Image to GHCR | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- ready_for_review | ||
|
||
push: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
|
||
jobs: | ||
trigger-build-push: | ||
uses: ./.github/workflows/build_push_node_images.yaml | ||
with: | ||
node_name: fe | ||
docker_file: './DockerFile_FrontEnd' | ||
secrets: inherit |
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,50 @@ | ||
name: Build & Push StarRocks Node to GHCR | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
node_name: | ||
description: 'Name of the node to build and push, e.g. fe or cn' | ||
required: true | ||
type: string | ||
docker_file: | ||
description: 'Path to the docker file' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-push-tool-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out GitHub Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get current date | ||
id: date | ||
run: echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: '${{ secrets.GHCR_USERNAME }}' | ||
password: '${{ secrets.GHCR_TOKEN }}' | ||
|
||
- name: Build and push node images | ||
id: build-and-push | ||
run: | | ||
dockerfile=${{ inputs.docker_file }} | ||
tag="ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}:${{inputs.node_name}}-pr-${{ github.event.number }}" | ||
echo "Building and pushing ${{ inputs.node_name }} image..." | ||
echo "tagging image with $tag" | ||
docker buildx build --file "$dockerfile" --tag "$tag" \ | ||
--build-arg "BUILD_DATE=${{ steps.date.outputs.date }}" \ | ||
--build-arg "VCS_REF=${{ github.sha }}" \ | ||
--build-arg "BRANCH=${{ github.ref }}" \ | ||
--build-arg "TAG=${{ github.ref }}" \ | ||
--push . |
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
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