Skip to content

Replace GitHub Actions reindex with a Railway cron service - #3

Merged
julianam-w merged 1 commit into
mainfrom
chore/railway-cron-reindex
Aug 3, 2026
Merged

Replace GitHub Actions reindex with a Railway cron service#3
julianam-w merged 1 commit into
mainfrom
chore/railway-cron-reindex

Conversation

@julianam-w

Copy link
Copy Markdown
Collaborator

Moves the scheduled RAG reindex off GitHub Actions and onto a Railway cron service, so the Postgres database no longer needs public access.

Why

GitHub-hosted runners are external to Railway's private network, so the old reindex.yml workflow required a publicly reachable DATABASE_PUBLIC_URL. A Railway cron service runs inside the project network and can use the internal DATABASE_URL — no public exposure.

Changes

  • Remove .github/workflows/reindex.yml.
  • Dockerfile: copy scripts/ into the image (previously only mcp_server.py + rag/ were copied), so the cron service can run scripts/sync.py and scripts/ingest.py.

Railway setup (manual, after merge)

Add a second service in the same project from this repo:

  • Start command: uv run python scripts/sync.py
  • Cron schedule: 0 15 * * * (UTC — matches the old daily sync)
  • Variables: DATABASE_URL=${{Postgres.DATABASE_URL}} (internal), VOYAGE_API_KEY, GITHUB_TOKEN

Manual full reindex (replaces the old workflow_dispatch):
railway run --service <cron-service> uv run python scripts/ingest.py --repo <url> --namespace <ns>

🤖 Generated with Claude Code

The scheduled reindex previously ran on GitHub-hosted runners, which are
external to Railway and therefore required exposing Postgres publicly
(DATABASE_PUBLIC_URL). Moving it to a Railway cron service in the same
project lets it use the internal DATABASE_URL, so the database never
needs public access.

- Remove .github/workflows/reindex.yml
- Copy scripts/ into the image so the cron service can run scripts/sync.py
  (and scripts/ingest.py for a manual full reindex)

Cron service is configured in Railway: start command
`uv run python scripts/sync.py`, cronSchedule "0 15 * * *" (UTC).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@julianam-w
julianam-w merged commit 51d0939 into main Aug 3, 2026
@julianam-w
julianam-w deleted the chore/railway-cron-reindex branch August 3, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant