Replace GitHub Actions reindex with a Railway cron service - #3
Merged
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlworkflow required a publicly reachableDATABASE_PUBLIC_URL. A Railway cron service runs inside the project network and can use the internalDATABASE_URL— no public exposure.Changes
.github/workflows/reindex.yml.Dockerfile: copyscripts/into the image (previously onlymcp_server.py+rag/were copied), so the cron service can runscripts/sync.pyandscripts/ingest.py.Railway setup (manual, after merge)
Add a second service in the same project from this repo:
uv run python scripts/sync.py0 15 * * *(UTC — matches the old daily sync)DATABASE_URL=${{Postgres.DATABASE_URL}}(internal),VOYAGE_API_KEY,GITHUB_TOKENManual 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