infer deploy type, which enables the action to determine whether to use either a dags-only deploy or an image-and-dags deploy, depending on the files you change.
Prerequisites
- An Astro project hosted in a GitHub repository.
- An Astro Deployment.
- A Deployment API token, Workspace API token, or Organization API token.
- Access to GitHub Actions.
If you stage multiple commits to dag files and push them all at once to your remote branch, the template only deploys dag code changes from the most recent commit. It will miss any code changes made in previous commits.To avoid this, either push commits individually or configure your repository to Squash commits for pull requests that merge multiple commits simultaneously.
Setup
Each template installs the Astro CLI with
setup-astro-cli before deploy-action runs. Astronomer recommends installing the CLI in a separate step so that you can pin or upgrade the CLI version independently of the action, including with Dependabot, and reuse a single installation across multiple deploy steps. To pin a version, set the version input, for example version: "1.40.1". If you omit this step, deploy-action installs the latest version of the Astro CLI itself.- Single branch
- Multiple branch
- Custom Image
To automate code deploys to a single Deployment using GitHub Actions, complete the following setup in a Git-based repository that hosts an Astro project:
- Set the following as a GitHub secret:
ASTRO_API_TOKEN: The value for your Workspace or Organization API token.
- In your project repository, create a new YAML file in
.github/workflowsthat includes the following configuration:
- (Optional) You can add optional configurations to customize your workflow. For example, if you add
wake-on-deployto your configuration, the Deploy Action wakes a hibernating Deployment before deploying code to it.