Files
James Wampler bb2a499569
CI / build-and-push (push) Successful in 46s
CI / deploy (push) Successful in 9s
Expose Novelly API port + service-key auth for MCP access to QA deploy
MCP server is a stdio process run outside docker, pointed at the API
over HTTP via NOVELLY_API_URL. The api container previously had no
port mapping, so it was unreachable outside the compose network.
2026-08-21 09:42:10 -07:00

77 lines
2.6 KiB
YAML

# CI/CD pipeline for Novelly. Read by both Gitea Actions and GitHub Actions (both look
# under .github/workflows/). Every non-checkout step just invokes a bash script under
# scripts/ci/, so the entire pipeline is reproducible by running the same scripts
# locally — no marketplace build/test/push actions.
#
# Gitea (origin) is the only remote that runs this on push — gated by the
# `github.server_url` check below (identical on both engines: https://github.com on
# GitHub, the Gitea instance URL on Gitea). GitHub pushes intentionally do nothing for
# now; GitHub will get its own release-triggered workflow later.
name: CI
on:
push:
paths-ignore: [badges/**]
jobs:
build-and-push:
if: github.server_url != 'https://github.com'
runs-on: ubuntu-latest
permissions:
contents: write
env:
REGISTRY: ${{ secrets.REGISTRY }}
REGISTRY_OWNER: ${{ secrets.REGISTRY_OWNER }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Build
run: ./scripts/ci/build.sh
- name: Test
run: ./scripts/ci/test.sh
- name: Coverage report
run: ./scripts/ci/coverage.sh
- name: Publish coverage badge
env:
GITHUB_TOKEN: ${{ github.token }}
run: ./scripts/ci/publish-coverage-badge.sh
- name: Build Docker images
if: github.ref_name == 'main'
run: ./scripts/ci/docker-build.sh
- name: Push Docker images
if: github.ref_name == 'main'
run: ./scripts/ci/docker-push.sh
deploy:
needs: build-and-push
if: success() && github.ref_name == 'main'
runs-on: [self-hosted, qa]
env:
REGISTRY: ${{ secrets.REGISTRY }}
REGISTRY_OWNER: ${{ secrets.REGISTRY_OWNER }}
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
WEB_PORT: ${{ vars.WEB_PORT }}
API_PORT: ${{ vars.API_PORT }}
MCP_API_KEY: ${{ secrets.MCP_API_KEY }}
steps:
# actions/checkout@v4 is a Node-based action; this runner has no node in PATH, so
# checkout plain git instead of via marketplace action.
- name: Checkout
run: |
git init -q .
git remote add origin "${{ github.server_url }}/${{ github.repository }}.git"
git -c http.extraheader="AUTHORIZATION: bearer ${{ github.token }}" fetch --depth=1 origin "${{ github.sha }}"
git checkout -q FETCH_HEAD
- name: Deploy
run: ./scripts/ci/deploy.sh