ci: update registry publish image #4
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: CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-build-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: yarn | |
| - name: Install dependencies | |
| run: yarn install --frozen-lockfile | |
| - name: Lint and format check | |
| run: yarn run check | |
| - name: Build | |
| run: yarn build | |
| docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| load: true | |
| tags: threatzone-mcp:ci | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| provenance: false | |
| - name: Smoke-test container | |
| run: | | |
| docker run -d --rm --name tz-mcp-ci -p 7860:7860 threatzone-mcp:ci | |
| for i in $(seq 1 30); do | |
| if curl -fsS http://127.0.0.1:7860/healthz >/dev/null; then | |
| echo "healthz responded ok after ${i}s" | |
| docker stop tz-mcp-ci | |
| exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "healthz never came up" | |
| docker logs tz-mcp-ci || true | |
| docker stop tz-mcp-ci || true | |
| exit 1 |