G2P-5032 Folder names simplified. #2
This file contains hidden or 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
| name: Publish SPAR Mapper Partner API Docker | |
| # Builds the SPAR Mapper Partner API image from the LOCAL in-repo source | |
| # (core/). The image tag is the repository ref (branch name or git tag). | |
| # | |
| # Per-image path filtering: this image embeds openg2p-spar-models + | |
| # openg2p-spar-mapper-core + openg2p-spar-mapper-partner-api, so it rebuilds | |
| # only when one of those (or its Dockerfile / this workflow) changes. | |
| # | |
| # External OpenG2P libs are not in this repo; their ref is a workflow_dispatch | |
| # input (shown with a default in the Actions UI). Push/tag builds use the default. | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| tags: | |
| - "**" | |
| paths: | |
| - 'core/models/**' | |
| - 'core/mapper-core/**' | |
| - 'core/mapper-partner-api/**' | |
| - 'docker/spar-apis/mapper-partner-api/**' | |
| - '.github/workflows/docker-build-mapper-partner-api.yml' | |
| workflow_dispatch: | |
| inputs: | |
| fastapi_common_ref: | |
| description: "openg2p-fastapi-common git ref (tag/branch)" | |
| default: "v1.1.5" | |
| type: string | |
| env: | |
| IMAGE_NAME: openg2p/openg2p-spar-mapper-partner-api | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| name: Docker - mapper-partner-api | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker Login | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.docker_hub_actor }} | |
| password: ${{ secrets.docker_hub_token }} | |
| - name: Derive image tag from repo ref | |
| id: meta | |
| shell: bash | |
| run: | | |
| echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT" | |
| echo "created=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT" | |
| - name: Build and push - mapper-partner-api | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/spar-apis/mapper-partner-api/Dockerfile | |
| push: true | |
| platforms: linux/amd64 | |
| build-args: | | |
| FASTAPI_COMMON_REF=${{ inputs.fastapi_common_ref || 'v1.1.5' }} | |
| tags: ${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tag }} | |
| labels: | | |
| org.opencontainers.image.created=${{ steps.meta.outputs.created }} | |
| org.opencontainers.image.authors=${{ github.repository_owner }} | |
| org.opencontainers.image.source=${{ github.repository }}@${{ github.sha }} | |
| org.opencontainers.image.version=${{ steps.meta.outputs.tag }} | |
| org.opencontainers.image.revision=${{ github.sha }} | |
| org.opencontainers.image.vendor=${{ github.repository_owner }} | |
| org.opencontainers.image.title=${{ env.IMAGE_NAME }} | |
| org.opencontainers.image.description=SPAR Mapper Partner API service image | |
| org.openg2p.service.name=mapper-partner-api |