CI/CD Configuration

Configure continuous integration and deployment.

Pipeline YAML

name: Deploy to Production

trigger:
  branches: [main]

stages:
  - name: Build
    steps:
      - run: npm install
      - run: npm run build
      - artifact: dist/

  - name: Test
    steps:
      - run: npm test
      - run: npm run lint

  - name: Deploy
    needs: [Build, Test]
    steps:
      - deploy:
          app: my-app
          environment: production

Environment Variables

env:
  NODE_ENV: production
  API_KEY: ${{ secrets.API_KEY }}

Conditions

deploy:
  condition: ${{ github.ref == 'refs/heads/main' }}