| 1 | # g1t/detect |
| 2 | |
| 3 | Says what a [g1t.page](https://docs.g1t.sh/guides/deployments/) build of |
| 4 | the checkout would find, without building or deploying anything: the |
| 5 | same rules [g1t/deploy](https://g1t.sh/g1t/deploy) builds with. |
| 6 | |
| 7 | ```yaml |
| 8 | steps: |
| 9 | - uses: actions/checkout@v5 |
| 10 | - id: detect |
| 11 | uses: g1t/detect@v1 |
| 12 | - if: steps.detect.outputs.kind == 'none' |
| 13 | run: echo "::error::Nothing here would be served." |
| 14 | - if: steps.detect.outputs.install != '' |
| 15 | run: ${{ steps.detect.outputs.install }} |
| 16 | ``` |
| 17 | |
| 18 | ## Inputs |
| 19 | |
| 20 | | Input | Default | | |
| 21 | | --- | --- | --- | |
| 22 | | `root-dir` | The checkout | Where the project is in the checkout. | |
| 23 | | `build-command` | None | A build command of your own, as `g1t/deploy` takes it. | |
| 24 | | `output-dir` | None | An output folder of your own, as `g1t/deploy` takes it. | |
| 25 | |
| 26 | ## Outputs |
| 27 | |
| 28 | | Output | | |
| 29 | | --- | --- | |
| 30 | | `kind` | `workers` (a `wrangler.jsonc`, `wrangler.json` or `wrangler.toml`), `static` (a site a build writes), `html` (the files as they are) or `none`. | |
| 31 | | `install` | How dependencies are installed, from the lockfile: `npm ci`, `pnpm install --frozen-lockfile`, and so on. Empty without a `package.json`. | |
| 32 | | `build` | What builds it: your command, `npm run build` for a package with a build script, or `wrangler deploy --dry-run` for Workers. Empty when nothing does. | |
| 33 | | `output-dir` | The folder served, relative to the project (`.` for the project itself): a Workers project's assets directory, or the first of `dist`, `build`, `out`, `public`, `_site`, `.output/public` that exists. Empty when a build has yet to write it. | |
| 34 | |
| 35 | It runs `g1t-runner detect`, found or downloaded as `g1t/deploy` finds it. |