Use the CLI in CI/CD
Run ast push and ast deploy -f as an app, with no personal login
When ASTRO_CLIENT_ID and ASTRO_CLIENT_SECRET are set, the CLI signs in as an app instead of a person. An app is an identity that belongs to one account, holds only the scopes granted to it, and keeps working when its creator leaves the account.
The CLI exchanges the client ID and secret for a short-lived token, renews it before it expires, and keeps it in memory only. No ast login or ast account switch is needed: the account comes from the app.
Environment variables
Supported commands
A scope applies to every resource of that kind in the app’s account. An app acts only on its own account.
Other commands that call Astropods require a person, and fail when run as an app. ast login and ast account switch refuse to run while ASTRO_CLIENT_ID is set.
Create the credentials
Creating an app requires the app:manage permission, which account administrators hold.
Examples
ast push builds the image on the runner, so the runner requires Docker. The installer adds ~/.ast/bin to the shell profile, which CI steps don’t read, so each example adds it to PATH.
GitHub Actions
GitLab CI
Repository secrets are under Settings > Secrets and variables > Actions.
Behavior as an app
ast pushrequires--yes. Push stops on a blueprint that already exists unless the current checkout pushed it before. A CI checkout has no record of earlier pushes.- Deployments have no web access. A deployment an app creates has no one on its web interface. Grant access on the deployment’s page, or set
publicinastropods.deploy.yml. - The audit log names the app. Each push and deploy shows the app as the actor in Settings > Audit log.
Rotate and revoke
Errors
Each error prints a headline, the error that caused it, and a fix.
Next steps
- Deploy Spec: the
astropods.deploy.ymlformat - ast blueprint: every push and deploy flag
- Install the CLI: other ways to install
ast