name: Build # Triggers: Equivalent to ADO trigger block on: push: branches: - develop # paths: # - 'app/**' # - '.github/workflows/**' # Concurrency: Equivalent to batch: true concurrency: group: ${{ github.workflow }}-${{ github.ref }} 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: # This job defines the matrix and calls the reusable workflow for each image call-build-template: name: Build ${{ matrix.image_config.IMAGE_NAME }} # Define necessary permissions if needed (e.g., for GitHub Packages) permissions: contents: read packages: write # If pushing to GitHub Packages registry # Use secrets defined in the repository/organization settings # 'inherit' makes all secrets available to the called workflow secrets: inherit # Define the matrix strategy based on the 'images' object from the original ADO build.yml strategy: fail-fast: false # Don't cancel other matrix jobs if one fails matrix: # We wrap the image configuration in a single 'image_config' key # to pass it more easily if needed, but primarily access sub-keys directly. image_config: - IMAGE_NAME: backend-aimingmedai BUILD_CONTEXT: ./app/backend DOCKERFILE: ./app/backend/Dockerfile # Call the reusable workflow uses: ./.github/workflows/template_build.yml # Path to the reusable workflow file # Pass inputs required by the reusable workflow with: # Pass values from the matrix context and global env project_name: aimingmed-ai repo: https://github.com/aimingmed image_name: ${{ matrix.image_config.IMAGE_NAME }} build_context: ${{ matrix.image_config.BUILD_CONTEXT }} dockerfile: ${{ matrix.image_config.DOCKERFILE }} build_id: ${{ github.run_id }} commit_sha: ${{ github.sha }}