G2P-5032 Consolidation. WIP. #1
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: Build & Push SPAR Bene Portal API Docker | |
| # Builds the SPAR Bene Portal 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-bene-portal-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/openg2p-spar-models/**' | |
| - 'core/openg2p-spar-mapper-core/**' | |
| - 'core/openg2p-spar-bene-portal-api/**' | |
| - 'docker/spar-apis/bene-portal-api/**' | |
| - '.github/workflows/docker-build-bene-portal-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-bene-portal-api | |
| jobs: | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| name: Docker - bene-portal-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 - bene-portal-api | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/spar-apis/bene-portal-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 Bene Portal API service image | |
| org.openg2p.service.name=bene-portal-api |