# Private repos without GitHub Actions

> In a private repo nothing in ghosty-dev or Ghosty depends on GitHub Actions. What runs where (the evidence gate, CI and deploy) and the ci, deploy and deploy_check keys in .ghosty/dev.md.

URL: https://www.ghosty.studio/en/docs/factory/private-repos

In a **private** repo, GitHub Actions costs minutes and can switch off at once (for example, when an account payment
fails: jobs stop starting and everything stays red). So in a private repo **no step of ghosty-dev or Ghosty uses
Actions**. In a **public** repo nothing changes: Actions is free there.

## What runs where

| Step | Private repo | Public repo |
|---|---|---|
| `ghosty-dev/evidencia` gate | Ghosty evaluates it and publishes it as a GitHub App check. | The repo's Action (`.github/workflows/evidence-gate.yml`). |
| PR CI | The **«Ghosty · CI»** check: the `ci:` commands in the preview box. | The repo's workflows. |
| Deploy after merge | `ghosty-dev deploy` in your terminal (`ghosty-dev merge` runs it). | The deploy workflow on push. |

The gate uses the **same rules** either way: valid evidence on the task, a clean review of the commit («Ghosty Review»
or another reviewer from `.github/ghosty-dev/config.json`) and a preview that builds. It re-evaluates on its own when the
PR is opened or updated, when its description changes, when someone comments on or edits the task it closes (evidence,
confirmations) and when the review or the preview finishes. If a `- [~]` criterion awaits your verification, the check
stays **in progress** with «Falta tu verificación: …» until you confirm it.

To run it again by hand: `ghosty-dev` does it on its own when it publishes evidence or confirms. Through the API:

```bash
curl -X POST https://www.ghosty.studio/api/v2/me/repos/<owner>/<repo>/prs/<n>/gate \
  -H "Authorization: Bearer <token from ghosty-dev login, scope dev>"
# → { "conclusion": "success" | "failure" | "neutral", "summary": "…", "details": ["…"], "sha": "…" }
```

`neutral` = it passes, but the person's verification is missing. On a public repo it answers `409`: its gate is the Action.

## The `.ghosty/dev.md` keys

They go in the frontmatter of `.ghosty/dev.md` (or `.ghosty/factory.md`), on the main branch:

```yaml
---
ci:
  - npm run typecheck
  - npm test
deploy: ./scripts/deploy-fly.sh
deploy_check: https://formmy.app/api/health
---
```

- **`ci:`** — a list of shell commands. They run in order, at the repo root, inside the commit's preview box, **after**
  install (with the preview's same `.env` and `CI=1`). It stops at the first failure. Up to 10 commands and 15 min each.
  The result is the «Ghosty · CI» check with the tail of the output (without your variables' values). It counts as CI
  for the merge. One line works too: `ci: [npm test, npm run typecheck]`. If the preview doesn't build, «Ghosty · CI» is
  neutral and «Ghosty · Preview» is what blocks.
- **`deploy:`** — the command that ships to production. `ghosty-dev deploy` runs it in your local clone (clean tree,
  main branch up to date). `ghosty-dev merge` runs it on its own after merging.
- **`deploy_check:`** — optional: a URL that must answer 200 after the deploy for it to count as good.

The deploy result is recorded in the log (a note on the task) and on the card: **In production**, **Deploy failed** or,
if nobody has run it yet, **Pending: run `ghosty-dev deploy` in your terminal** (a merge done from the cloud can't deploy
for you: the deploy uses your local credentials).

## If your private repo already had the ghosty-dev workflows

`ghosty-dev init` no longer writes `evidence-gate.yml` or `ghosty-checks.yml` in a private repo, and `ghosty-dev doctor`
warns if it still has them. You can delete them: Ghosty publishes the gate under the same name, so a branch protection
that requires `ghosty-dev/evidencia` keeps working.

See also [Your workspace's CI box](/en/docs/factory/ci-box), to run full workflows on your own boxes.
