feat(compat): add Cipherscan API adapter #22
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-images | |
| # Build every runtime image on PRs that could affect Rust binaries, Docker | |
| # contexts, or the image workflow. Tagged releases push through | |
| # release-images.yml. | |
| on: | |
| pull_request: | |
| paths: | |
| - "Cargo.toml" | |
| - "Cargo.lock" | |
| - "rust-toolchain.toml" | |
| - ".dockerignore" | |
| - "crates/**" | |
| - "services/**" | |
| - "deploy/Dockerfile" | |
| - "deploy/docker-compose.yml" | |
| - "deploy/single-container/**" | |
| - "buf.yaml" | |
| - ".github/workflows/build-images.yml" | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: build runtime images | |
| runs-on: ubuntu-latest | |
| env: | |
| PR_TAG: pr-${{ github.event.pull_request.number || 'manual' }} | |
| CACHE_SCOPE: zinder-rust-pr | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and smoke test images | |
| run: | | |
| set -euo pipefail | |
| images=( | |
| "zinder-ingest:zinder-ingest:zinder-ingest" | |
| "zinder-query:zinder-query:zinder-query" | |
| "zinder-compat-lightwalletd:zinder-compat-lightwalletd:zinder-compat-lightwalletd" | |
| "zinder-explorer:zinder-explorer:zinder-explorer" | |
| "zinder:zinder-single-container:zinder-query" | |
| ) | |
| for image in "${images[@]}"; do | |
| IFS=: read -r image_name target help_entrypoint <<< "$image" | |
| docker buildx build \ | |
| --file deploy/Dockerfile \ | |
| --target "$target" \ | |
| --load \ | |
| --tag "${image_name}:${PR_TAG}" \ | |
| --cache-from "type=gha,scope=${CACHE_SCOPE}" \ | |
| --cache-to "type=gha,scope=${CACHE_SCOPE},mode=max" \ | |
| . | |
| docker image inspect "${image_name}:${PR_TAG}" \ | |
| --format 'image={{.Id}} size_bytes={{.Size}}' | |
| docker run --rm --entrypoint="$help_entrypoint" "${image_name}:${PR_TAG}" --help | |
| done |