All Guides
Automation15 min read

CI/CD Pipelines

Build continuous integration and deployment pipelines with GitHub Actions, GitLab CI, and custom webhook triggers.

1.Pipeline Configuration

Define CI/CD pipelines as code in your repository.

  1. Create .oxaploy/ci.yml or .github/workflows/deploy.yml
  2. Define stages: build, test, security scan, deploy
  3. Use Oxaploy CLI or API for deployment steps
  4. Cache dependencies: cache: key: npm-${{ hashFiles('package-lock.json') }}
  5. Matrix builds: test multiple Node/Python/Go versions
# .oxaploy/ci.yml
stages:
  - build
  - test
  - security
  - deploy

build:
  image: node:20-alpine
  script:
    - npm ci
    - npm run build
  artifacts:
    paths: [dist/]
    expire_in: 1h

test:
  image: node:20-alpine
  script:
    - npm ci
    - npm test
    - npm run lint

security:
  image: aquasec/trivy:latest
  script:
    - trivy fs --exit-code 1 --severity HIGH,CRITICAL .

deploy:
  image: oxaploy/cli:latest
  script:
    - oxaploy deploy --app $APP_NAME --token $OXAPLOY_TOKEN
  only:
    - main

2.GitHub Actions Integration

Use GitHub Actions for CI with Oxaploy deployment.

  1. Add OXAPLOY_TOKEN to GitHub repository secrets
  2. Create .github/workflows/deploy.yml
  3. Use oxaploy/cli Docker image for deployment
  4. Trigger on push to main, PR merge, or manual dispatch
  5. Pass environment variables via GitHub secrets
# .github/workflows/deploy.yml
name: Deploy to Oxaploy
on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
    deploy:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v4
        - name: Deploy to Oxaploy
          uses: oxaploy/action@v1
          with:
            token: ${{ secrets.OXAPLOY_TOKEN }}
            app: my-app

3.Deployment Triggers

Automate deployments based on events.

  1. Push to main/production branch → auto-deploy
  2. PR merged → deploy to staging
  3. Tag push (v1.0.0) → deploy to production
  4. Manual trigger: workflow_dispatch for hotfixes
  5. Schedule: nightly builds for dependencies updates
  6. Webhook: trigger from external systems (Jira, custom)

4.Rollback Strategies

Quickly revert problematic deployments.

  1. Oxaploy keeps last 10 deployments per app
  2. One-click rollback in dashboard: Rollback button
  3. CLI: oxaploy rollback --app myapp --version v1.2.3
  4. Database migrations: use down migrations or backup restore
  5. Canary deployments: deploy to 10% traffic first
  6. Feature flags: toggle features without redeploy