Setup Astro CLI
ActionsVerified
This GitHub action installs the Astro CLI for use in subsequent steps or actions.
This action is maintained separately from deploy-action to:
- Decouple CLI installation from deployment logic
- Allow users to control CLI versions independently across workflows
- Simplify upgrade paths for the CLI in CI/CD environments (Dependabot-compatible)
- Enable reuse of a single CLI installation across multiple deploy steps
To use this action, add it as a step in your GitHub Actions workflow before any step that requires the Astro CLI. For example:
- Add the action to your workflow, e.g.
astronomer/setup-astro-cli@v0.0.1. - Optionally configure the
versionordownload-urlinputs to control which CLI binary is installed. - Run subsequent steps that call the
astroCLI — it will be available inPATH.
The following table lists the configuration options for the Setup Astro CLI action.
| Name | Default | Description |
|---|---|---|
version |
"" (latest) |
The desired Astro CLI version to install. Example: 1.40.1 or v1.40.1. Defaults to the latest version. |
download-url |
"" |
Direct URL to download the Astro CLI binary. Supports both raw binaries and .tar.gz archives. When set, bypasses the standard installer. |
The following table lists the outputs for the Setup Astro CLI action.
| Name | Description |
|---|---|
cli-version |
The version of the Astro CLI that was installed or found |
cli-path |
The absolute path to the Astro CLI binary |
The action resolves the Astro CLI using the following priority:
astroalready inPATH— use the pre-installed CLI, no download performeddownload-urlinput — download the binary directly to~/.local/bin- Standard installer — download via
godownloader.shinto~/.local/bin
In the following example, the action installs the latest Astro CLI and then deploys an Astro project. This is the most common usage pattern.
steps:
- name: Install Astro CLI
uses: astronomer/setup-astro-cli@v0.0.1
- name: Deploy to Astro
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <deployment-id>In the following example, a specific CLI version is pinned via the version input, which is useful when a deployment step requires a minimum CLI version.
steps:
- name: Install Astro CLI
uses: astronomer/setup-astro-cli@v0.0.1
with:
version: "1.29.0"
- name: Deploy to Astro
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <deployment-id>In the following example, the CLI binary is downloaded from an internal mirror instead of GitHub Releases. This is useful for runners without public internet access.
steps:
- name: Install Astro CLI
uses: astronomer/setup-astro-cli@v0.0.1
with:
download-url: https://mirror.example.com/astro-cli/v1.29.0/astro_linux_amd64.tar.gz
- name: Deploy to Astro
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <deployment-id>In the following example, the CLI is installed once and reused across two separate deploy steps, avoiding redundant downloads in the same job.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Astro CLI
uses: astronomer/setup-astro-cli@v0.0.1
- name: Deploy to Development
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <dev-deployment-id>
- name: Deploy to Staging
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <staging-deployment-id>In the following example, the CLI is installed once and used to deploy both a DBT project and DAGs from the same repository.
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Install Astro CLI
uses: astronomer/setup-astro-cli@v0.0.1
with:
version: "1.30.0" # DBT deploys require CLI >= 1.28.1
- name: Deploy DBT project
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <deployment-id>
deploy-type: dbt
root-folder: dbt
- name: Deploy DAGs
uses: astronomer/deploy-action@v0.12.0
with:
deployment-id: <deployment-id>
root-folder: astro-projectSetup Astro CLI is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.