CI/CD Integration

OPS can be integrated into CI/CD pipelines for automated deployments.

Authentication

Set the OPS_TOKEN environment variable in your pipeline. Get the token:

ops token

Add it as a secret in your CI/CD provider (e.g., OPS_TOKEN in GitHub Actions secrets).

GitHub Actions Example

name: Deploy
on:
  push:
    branches: [main]

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

      - name: Install OPS
        run: curl -fsSL https://get.ops.autos | sh

      - name: Deploy
        env:
          OPS_TOKEN: ${{ secrets.OPS_TOKEN }}
        run: ops deploy

SSH Access in CI

Use ops ci-keys to get the SSH private key for direct server access:

Deploy Specific Services

Restart Without Rebuilding

Custom Config File

Deployment Status

OPS automatically tracks deployment status in the backend. Each ops deploy creates a deployment record with status (success or failed), visible in the web dashboard.

Last updated