Skip to Content
Aperture

Deploying from CI

Deploy and run jobs from a CI/CD pipeline with a scoped project key.

Use a project key in CI rather than a personal token. It works only on one project, only for the actions you choose, and it isn't tied to a person.

1. Create a project key

In the dashboard, open the project's settings and add a key under CI Keys. Pick its scopes:

  • deploy to deploy jobs,
  • run to run, schedule and cancel them,
  • read to list jobs and read executions.

Copy the apk_… token; it's shown once. Creating keys needs the owner or admin role. You can also create keys with the API.

2. Configure the pipeline

Store the token and the project ID as CI secrets, then expose them as APERTURE_AUTH_TOKEN and APERTURE_PROJECT_ID. The CLI needs no login or config file.

.github/workflows/deploy-jobs.yml
name: Deploy jobs
on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      APERTURE_AUTH_TOKEN: ${{ secrets.APERTURE_PROJECT_KEY }}
      APERTURE_PROJECT_ID: ${{ vars.APERTURE_PROJECT_ID }}
      # APERTURE_API_URL: https://aperture.example.com  # self-hosted only
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version: '1.24'
      - uses: actions/setup-node@v4 # if your jobs build with npm
        with:
          node-version: '22'
      - name: Install aperture-cli
        run: |
          # The CLI's source must be available to the pipeline, e.g. checked out
          # from the Aperture repository or vendored in yours.
          cd path/to/aperture/cli && go build -o /usr/local/bin/aperture-cli ./cmd/aperture-cli.go
      - run: aperture-cli deploy nightly-report
      - run: aperture-cli deploy weekly-digest

Calling the API directly

Project keys work with plain HTTP too:

curl -X POST "$APERTURE_API_URL/api/v1/jobs/run" \
  -H "Authorization: Bearer $APERTURE_AUTH_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"job": {"name": "nightly-report", "project_id": "'"$APERTURE_PROJECT_ID"'", "params": {"DRY_RUN": "true"}}}'

Managing keys

Owners and admins can rename, disable, rotate (issue a new token and invalidate the old one) or delete keys from the project settings. The key list shows each key's prefix and when it was last used. Project keys don't expire.

On this page