Deploy with git

Deploy Airplane tasks automatically as you push code.
In addition to deploying tasks using the CLI, you can automatically deploy Airplane tasks through version control (sometimes called continuous deployment). This process might look similar to how you deploy other production systems:
  1. Open a pull request with changes using a version control system like GitHub.
  2. Merge approved code into a main branch.
  3. New code automatically builds and deploys to production.

GitHub action

To simplify deploying from GitHub, you can use the airplane-deploy GitHub action.

Usage

See airplane-deploy for full instructions and usage.
yaml
Copied
1
# airplane.yaml
2
name: airplane deploy
3
on:
4
push:
5
branches:
6
# Or "master"
7
- main
8
jobs:
9
deploy-tasks:
10
runs-on: ubuntu-latest
11
steps:
12
- uses: actions/checkout@v2
13
- name: Deploy Airplane Tasks
14
uses: airplanedev/airplane-deploy@v1
15
with:
16
# Add your API key as a secret: https://docs.github.com/en/actions/security-guides/encrypted-secrets.
17
# Generate a new API key by running `airplane apikeys create <key name>` from the CLI.
18
api-key: ${{ secrets.AIRPLANE_API_KEY }}
19
# Find this at https://app.airplane.dev/settings/team
20
team-id: <your_team_id>
Once airplane.yml is merged into main, subsequent pushes to main will deploy all Airplane tasks in the repo.

Deploying from another CI system

If you're using GitHub, we suggest using the airplane-deploy GitHub action (see above) to automatically deploy Airplane tasks.
You can also deploy Airplane tasks from your existing CI system like Jenkins or CircleCI

Install the CLI

Follow the instructions for installing the CLI inside your build environment.
The installer installs the CLI to `$HOME/.airplane/bin/airplane`. You can execute `airplane` from there or move it to an executable location.

Run airplane deploy

bash
Copied
1
export AP_API_KEY=<your_api_key>
2
export AP_TEAM_ID=<your_team_id>
3
airplane deploy ./path/to/tasks
  • Set an environment variable AP_API_KEY equal to your Airplane API key.
  • Set an environment variable AP_TEAM_ID equal to your Airplane team ID.
  • Deploy your Airplane tasks.
Airplane automatically detects version control information like the current git branch and commit. You can specify two additional environment variables - AP_GIT_REPO and AP_GIT_USER - to indicate the git repository and which user triggered the deploy respectively.