mirror of
https://github.com/aimingmed/aimingmed-ai.git
synced 2026-02-05 22:53:23 +08:00
update
This commit is contained in:
parent
ab01c1c2cc
commit
f1cc825845
12
.github/workflows/build_new.yml
vendored
12
.github/workflows/build_new.yml
vendored
@ -14,11 +14,6 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
# Global environment variables accessible in the calling job
|
|
||||||
env:
|
|
||||||
PROJECT_NAME: aimingmed-ai
|
|
||||||
REPO: https://github.com/aimingmed # Updated repo for aimingmed-ai
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# This job defines the matrix and calls the reusable workflow for each image build
|
# This job defines the matrix and calls the reusable workflow for each image build
|
||||||
build:
|
build:
|
||||||
@ -45,6 +40,9 @@ jobs:
|
|||||||
- IMAGE_NAME: frontend-aimingmedai
|
- IMAGE_NAME: frontend-aimingmedai
|
||||||
BUILD_CONTEXT: ./app/frontend
|
BUILD_CONTEXT: ./app/frontend
|
||||||
DOCKERFILE: ./app/frontend/Dockerfile.test
|
DOCKERFILE: ./app/frontend/Dockerfile.test
|
||||||
|
- IMAGE_NAME: tests-aimingmedai
|
||||||
|
BUILD_CONTEXT: ./app/tests
|
||||||
|
DOCKERFILE: ./app/tests/Dockerfile
|
||||||
|
|
||||||
# Call the reusable workflow
|
# Call the reusable workflow
|
||||||
uses: ./.github/workflows/template_build.yml # Path to the reusable workflow file
|
uses: ./.github/workflows/template_build.yml # Path to the reusable workflow file
|
||||||
@ -52,7 +50,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# Pass values from the matrix context and global env
|
# Pass values from the matrix context and global env
|
||||||
project_name: aimingmed-ai
|
project_name: aimingmed-ai
|
||||||
repo: https://github.com/aimingmed
|
image_repo: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/
|
||||||
image_name: ${{ matrix.image_config.IMAGE_NAME }}
|
image_name: ${{ matrix.image_config.IMAGE_NAME }}
|
||||||
build_context: ${{ matrix.image_config.BUILD_CONTEXT }}
|
build_context: ${{ matrix.image_config.BUILD_CONTEXT }}
|
||||||
dockerfile: ${{ matrix.image_config.DOCKERFILE }}
|
dockerfile: ${{ matrix.image_config.DOCKERFILE }}
|
||||||
@ -68,7 +66,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/template_test.yml # Path to the reusable workflow file
|
uses: ./.github/workflows/template_test.yml # Path to the reusable workflow file
|
||||||
with:
|
with:
|
||||||
projectName: aimingmed-ai
|
projectName: aimingmed-ai
|
||||||
repo: https://github.com/aimingmed
|
image_repo: ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/
|
||||||
# Pass test environment variables as JSON string
|
# Pass test environment variables as JSON string
|
||||||
testEnvs: >
|
testEnvs: >
|
||||||
[
|
[
|
||||||
|
|||||||
4
.github/workflows/template_build.yml
vendored
4
.github/workflows/template_build.yml
vendored
@ -10,7 +10,7 @@ on:
|
|||||||
project_name:
|
project_name:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
repo:
|
image_repo:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
image_name:
|
image_name:
|
||||||
@ -72,7 +72,7 @@ jobs:
|
|||||||
# Define tags consistently using inputs
|
# Define tags consistently using inputs
|
||||||
id: tags
|
id: tags
|
||||||
run: |
|
run: |
|
||||||
echo "image_repo_path=ghcr.io/$(echo $GITHUB_REPOSITORY | tr '[A-Z]' '[a-z]')/${{ inputs.image_name }}" >> $GITHUB_OUTPUT
|
echo "image_repo_path=${{ inputs.image_repo }}/${{ inputs.image_name }}" >> $GITHUB_OUTPUT
|
||||||
echo "tag_build_id=${{ inputs.build_id }}" >> $GITHUB_OUTPUT
|
echo "tag_build_id=${{ inputs.build_id }}" >> $GITHUB_OUTPUT
|
||||||
echo "tag_commit_sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
|
echo "tag_commit_sha=${{ inputs.commit_sha }}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|||||||
9
.github/workflows/template_test.yml
vendored
9
.github/workflows/template_test.yml
vendored
@ -6,7 +6,7 @@ on:
|
|||||||
projectName:
|
projectName:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
repo:
|
image_repo:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
images: # JSON string defining services for compose
|
images: # JSON string defining services for compose
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
# Env vars needed for compose file generation/execution
|
# Env vars needed for compose file generation/execution
|
||||||
REPO: ${{ inputs.repo }}
|
IMAGE_REPO: ${{ inputs.image_repo }}
|
||||||
PROJECT_NAME: ${{ inputs.projectName }}
|
PROJECT_NAME: ${{ inputs.projectName }}
|
||||||
TAG: ${{ github.run_id }} # Use run_id as the build tag
|
TAG: ${{ github.run_id }} # Use run_id as the build tag
|
||||||
|
|
||||||
@ -85,7 +85,8 @@ jobs:
|
|||||||
foreach ($img in $images) {
|
foreach ($img in $images) {
|
||||||
$serviceName = $img.name
|
$serviceName = $img.name
|
||||||
$svc = @{}
|
$svc = @{}
|
||||||
$svc.image = "${{ env.REPO }}/${{ env.PROJECT_NAME }}/$($serviceName):${{ env.TAG }}" # Use run_id tag
|
$svc.image = "${{ env.IMAGE_REPO }}/$($serviceName):${{ env.TAG }}" # Use run_id tag
|
||||||
|
|
||||||
if ($img.depends_on) {
|
if ($img.depends_on) {
|
||||||
$svc.depends_on = $img.depends_on
|
$svc.depends_on = $img.depends_on
|
||||||
}
|
}
|
||||||
@ -164,7 +165,7 @@ jobs:
|
|||||||
$ENV_ARGS \
|
$ENV_ARGS \
|
||||||
-v "$STAGING_DIR:$RESULTS_PATH" \
|
-v "$STAGING_DIR:$RESULTS_PATH" \
|
||||||
--rm \
|
--rm \
|
||||||
"${{ inputs.repo }}/${{ inputs.projectName }}/${{ inputs.testContainerName }}:${{ github.run_id }}" \
|
"${{ env.IMAGE_REPO }}/$($serviceName)/${{ inputs.testContainerName }}:${{ github.run_id }}" \
|
||||||
"$test_dir"
|
"$test_dir"
|
||||||
# Add error handling if needed (e.g., exit script if a test run fails)
|
# Add error handling if needed (e.g., exit script if a test run fails)
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user