Continuous deployment sounds intimidating but setting up your first pipeline takes under an hour. Let's do it.

Pipeline structure

Our pipeline has three stages: build (Docker image), test (parallel unit + integration), and deploy (blue-green to production).

# nexatech-pipeline.yml
stages:
  - build
  - test
  - deploy

build:
  image: node:20-alpine
  script:
    - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
    - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA

test:
  parallel: 4
  script:
    - npm test
    - npm run test:integration

deploy:
  strategy: blue-green
  environment: production
  only: [main]

Secrets

Never put secrets in pipeline YAML. Use the NexaTech secret store and inject them at runtime with nexatech secrets inject.