Build and deploy from GitHub
Connect a GitHub repository to a blueprint, and every push to its branch builds a new version. Add an astropods.deploy.yml, and each build also deploys to the environments the file names.
By the end of this guide, a push to main builds your blueprint and redeploys its production agent.
Before you start
- A repository with an
astropods.ymlin it. Runast project createto create one, and see Blueprint Spec for its keys. - A GitHub account that can read the repository. For a public repository, you also need push access.
- Permission to create or edit the blueprint in your Astropods account. To deploy from builds, you also need permission to deploy agents.
Connect the repository
Name the blueprint
Go to Blueprints and select Create blueprint. Enter a name, choose its visibility, and select Continue.
Connect your GitHub account
Choose Set up with GitHub, select Connect GitHub, and approve access on GitHub. You do this once for each Astropods account.
To connect a blueprint you already have, open it, go to Settings > Source, and select Connect GitHub repo. Pick the repository and branch, then select Connect repository. Connecting it starts a build.
Watch a build
Open the blueprint’s Builds tab. Each push to the branch adds a build, and the build moves from building to registered when the new version is in the registry. Select a build to read its logs.
If the branch has no astropods.yml at the path yet, the build fails at the spec step. Push the file, and the next build picks it up.
Deploy each build
Add an astropods.deploy.yml beside astropods.yml. It names the environments to deploy to and how to configure each one:
Commit the file and push it to the connected branch. After the build registers, Astropods deploys it to each environment whose branch matches the connected branch. An environment with no branch deploys on every build. An environment that doesn’t exist yet is created, with a new agent in it.
Set secrets such as OPENAI_API_KEY in the account or the environment before you push. See Managing secrets. The Deploy Spec lists every key the file takes.
To confirm the deploy, open the agent and check its deployment history for a new revision on the build you pushed.
How deploys behave
- Deploys run as you. Astropods deploys as the person who connected the repository, with that person’s permissions.
- A failed deploy doesn’t fail the build. The build stays registered, the other environments still deploy, and the person who connected the repository gets a notification with the reason.
- Settings-only pushes skip the build. When
astropods.deploy.ymlis the only file that changed, Astropods redeploys with the new settings and keeps each agent on its current build. - Vulnerability checks can delay a deploy. If your account blocks builds that haven’t been scanned, the deploy waits up to 10 minutes for the scan to finish.
Change the branch or disconnect
Open the blueprint’s Settings > Source page:
- Branch sets the branch that builds. Update
branchinastropods.deploy.ymlto match, or those environments stop deploying. - Disconnect stops builds from the repository. Builds already in the registry stay, and running agents keep running.
To build the branch’s latest commit again without a push, open Builds and select Rebuild branch from the newest build’s menu.
Troubleshooting
Next steps
- Deploy Spec: every key in
astropods.deploy.yml - Manage environments: set variables and secrets per environment
- Use the CLI in CI/CD: deploy from your own pipeline instead