astro deploy
Astro
Software
Deploy code to a Deployment on Astro.
This command bundles all files in your Astro project and pushes them to Astro. Before completing the process, it tests your dags in your Astro project for parse errors. If this test fails, the deploy to Astro will also fail. This is the same test which runs locally with astro dev parse
.
When you run astro deploy
, the CLI prompts you to select from a list of all Deployments that you can access across Workspaces. To bypass this prompt, you can also specify a Deployment ID in the command. To retrieve a Deployment ID, open your Deployment in the Astro UI and copy the value in the ID section of the Deployment page. You can also run astro deployment list
to find a Deployment ID or name.
For teams operating at scale, this command can be automated with a CI/CD pipeline by using Deployment API tokens in the request. When ASTRO_API_TOKEN
is specified as OS-level environment variables on your local machine or in a CI tool, astro deploy <deployment-id>
can be run without requiring user authentication.
To skip the parsing process before deploys, complete one of the following setups:
- Add
skip_parse: true
to.astro/config.yaml
in your Astro project. - Add
ASTRONOMER_SKIP_PARSE=true
as an environment variable to your local environment or CI/CD pipeline.
Usage
Options
Examples
To deploy directly to a specific Deployment:
To configure the Astro CLI to use a given Deployment and directory as a default for future deploys:
To use a custom Docker image from your local Docker registry to build your Astro project:
To deploy only dags from your Astro project to a specific Deployment:
The following error can sometimes occur when the CLI tries to build your Astro Runtime image using Podman:
You can resolve this issue by exporting the BUILDAH_FORMAT
environment variable to Podman:
If you use Docker Desktop, ensure that the Use containerd for pulling and storing images setting is turned off. Otherwise, you might receive errors when you run astro deploy
such as: