mirror of
https://gitea.com/gitea/docs.git
synced 2026-11-05 17:45:46 +00:00
Cover what users need to get going and leave the details to gt <command> --help and gt help. Signed-off-by: bircni <[email protected]>
37 lines
1.0 KiB
Markdown
37 lines
1.0 KiB
Markdown
---
|
|
sidebar_position: 4
|
|
---
|
|
|
|
# Using gt in CI
|
|
|
|
Give gt a token and an instance through the environment, and turn prompts off:
|
|
|
|
| Variable | Description |
|
|
| --- | --- |
|
|
| `GITEA_TOKEN` | Access token; gt never stores it |
|
|
| `GITEA_CLI_HOST` or `GITEA_INSTANCE_URL` | URL of the instance |
|
|
| `GITEA_CLI_REPO` | Repository, like `--repo` |
|
|
|
|
`--no-input` makes a command fail instead of prompting, and `--yes` confirms changes in
|
|
advance.
|
|
|
|
## Gitea Actions
|
|
|
|
Gitea does not allow secret names that start with `GITEA_`, so store the token as, for
|
|
example, `GT_TOKEN`:
|
|
|
|
```yaml
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GT_TOKEN }}
|
|
GITEA_CLI_HOST: ${{ gitea.server_url }}
|
|
GITEA_CLI_REPO: ${{ gitea.repository }}
|
|
steps:
|
|
- run: curl -fsSL https://gitea.com/gitea/cli/raw/branch/main/scripts/install.sh | sh
|
|
- run: gt workflow run deploy.yml --ref main --field env=staging --no-input
|
|
```
|
|
|
|
`gt run watch` and `gt pr checks --watch` wait for runs and checks and fail when they do.
|