Skip to content
Skip to content

CI/CD Integration

Automate deployments by running doku deploy in your existing CI/CD pipeline. Doku works with any CI system that can run shell commands.

CI Authentication

Generate an API key for your CI environment:

bash
doku auth login --token $DOKU_API_KEY

Store DOKU_API_KEY as a secret in your CI provider. Doku also needs access to your cloud provider credentials — see the provider-specific sections below.

Pipeline Configuration

Add this workflow to .github/workflows/deploy.yml:

yaml.github/workflows/deploy.yml
name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Doku CLI
        run: npm install -g @doku/cli

      - name: Deploy to staging
        run: doku deploy --env staging
        env:
          DOKU_API_KEY: ${{ secrets.DOKU_API_KEY }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - name: Deploy to production
        if: success()
        run: doku deploy --env production
        env:
          DOKU_API_KEY: ${{ secrets.DOKU_API_KEY }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

Required Environment Variables

VariableRequiredDescription
DOKU_API_KEYYesAuthentication token for the Doku API
AWS_ACCESS_KEY_IDAWS onlyAWS access key for infrastructure provisioning
AWS_SECRET_ACCESS_KEYAWS onlyAWS secret key
GOOGLE_APPLICATION_CREDENTIALSGCP onlyPath to GCP service account JSON
AZURE_CLIENT_IDAzure onlyAzure service principal client ID
CI/CD Integration — Doku Docs — Doku