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.
- Create .oxaploy/ci.yml or .github/workflows/deploy.yml
- Define stages: build, test, security scan, deploy
- Use Oxaploy CLI or API for deployment steps
- Cache dependencies: cache: key: npm-${{ hashFiles('package-lock.json') }}
- 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:
- main2.GitHub Actions Integration
Use GitHub Actions for CI with Oxaploy deployment.
- Add OXAPLOY_TOKEN to GitHub repository secrets
- Create .github/workflows/deploy.yml
- Use oxaploy/cli Docker image for deployment
- Trigger on push to main, PR merge, or manual dispatch
- 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-app3.Deployment Triggers
Automate deployments based on events.
- Push to main/production branch → auto-deploy
- PR merged → deploy to staging
- Tag push (v1.0.0) → deploy to production
- Manual trigger: workflow_dispatch for hotfixes
- Schedule: nightly builds for dependencies updates
- Webhook: trigger from external systems (Jira, custom)
4.Rollback Strategies
Quickly revert problematic deployments.
- Oxaploy keeps last 10 deployments per app
- One-click rollback in dashboard: Rollback button
- CLI: oxaploy rollback --app myapp --version v1.2.3
- Database migrations: use down migrations or backup restore
- Canary deployments: deploy to 10% traffic first
- Feature flags: toggle features without redeploy