> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jelou.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> Deployment flow, file limits, interactive and direct rollback, and CI/CD configuration with GitHub Actions.

## Deployment flow

When you run `jelou functions deploy`, the platform:

1. Reads `jelou.json` to find the slug and entrypoint
2. Collects all deployable files from the directory
3. Displays a summary with names and sizes
4. Uploads the files and runs the deployment
5. Renames your entrypoint to `user-function.ts`
6. Generates a `main.ts` wrapper that imports your code and starts the server
7. Injects your secrets as environment variables

```bash theme={null}
jelou functions deploy
# ▸ Files: index.ts (1.2 KB), helpers.ts (800 B), jelou.json (98 B), deno.json (65 B)
# ? Deploy query-customer? (Y/n) y
# ✓ Deployed
# ▸ ID:  dep_abc12345
# ▸ URL: https://query-customer.fn.jelou.ai
```

## File limits

| Limit                | Value                                |
| -------------------- | ------------------------------------ |
| Files per deployment | 20                                   |
| Size per file        | 256 KB                               |
| Total size           | 1 MB                                 |
| Allowed extensions   | `.ts`, `.js`, `.json`, `.md`, `.txt` |
| Required entrypoint  | `index.ts`                           |

### What is automatically excluded

* `node_modules/`
* `.git/`
* `.env`
* `dist/`
* `.jelou/`
* Hidden files (starting with `.`)

## Skip confirmation

For automated deployments, use `--no-confirm`:

```bash theme={null}
jelou functions deploy --no-confirm
```

## Rollback

If you need to revert to a previous version, use `jelou functions rollback`.

<Tabs>
  <Tab title="Interactive">
    Without arguments, it shows a menu with recent deployments:

    ```bash theme={null}
    jelou functions rollback
    # ? Select deployment to rollback to:
    #   ▸ dep_abc12345.. — 2 hours ago by alex@jelou.ai (current)
    #     dep_def67890.. — 1 day ago by ci@jelou.ai
    #     dep_ghi11223.. — 3 days ago by alex@jelou.ai
    ```
  </Tab>

  <Tab title="Direct">
    Specify the slug and deployment ID:

    ```bash theme={null}
    jelou functions rollback query-customer dep_def67890
    # ✓ Rolled back to dep_def67890
    ```
  </Tab>
</Tabs>

## CI/CD with GitHub Actions

<Tabs>
  <Tab title="Basic deployment">
    ```yaml deploy.yml theme={null}
    name: Deploy Function
    on:
      push:
        branches: [main]

    jobs:
      deploy:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4

          - name: Install CLI
            run: npm install -g @jelou/cli

          - name: Deploy
            env:
              JELOU_TOKEN: ${{ secrets.JELOU_TOKEN }}
            run: jelou functions deploy --no-confirm --json | jq '.data.url'
    ```
  </Tab>

  <Tab title="With secrets">
    ```yaml deploy.yml theme={null}
    name: Deploy with Secrets
    on:
      push:
        branches: [main]

    jobs:
      deploy:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4

          - name: Install CLI
            run: npm install -g @jelou/cli

          - name: Configure secrets
            env:
              JELOU_TOKEN: ${{ secrets.JELOU_TOKEN }}
            run: |
              jelou secrets set query-customer \
                CRM_API_KEY=${{ secrets.CRM_API_KEY }} \
                JELOU_API_KEY=${{ secrets.JELOU_API_KEY }}

          - name: Deploy
            env:
              JELOU_TOKEN: ${{ secrets.JELOU_TOKEN }}
            run: |
              DEPLOY_URL=$(jelou functions deploy --no-confirm --json | jq -r '.data.url')
              echo "Deployed to $DEPLOY_URL"
    ```
  </Tab>
</Tabs>

<Tip>
  Use `--json` in pipelines to get structured output you can parse with `jq`. The format is always `{ "ok": true, "data": ... }` on stdout.
</Tip>

## Exposed routes

<Tabs>
  <Tab title="define() mode">
    | Route       | Description                                   |
    | ----------- | --------------------------------------------- |
    | `/__health` | Health check and function metadata            |
    | `/mcp`      | MCP endpoint (unless `config.mcp: false`)     |
    | Your route  | Handler route (default: `*` matches any path) |
  </Tab>

  <Tab title="app() mode">
    | Route         | Description                                                           |
    | ------------- | --------------------------------------------------------------------- |
    | `/__health`   | Health check with list of all tools                                   |
    | `/mcp`        | Unified MCP server with all tools                                     |
    | `/<tool-key>` | Each tool's route (auto-generated kebab-case or custom `config.path`) |
  </Tab>
</Tabs>
