Appearance
Custom Build Commands
Advanced configuration for all project types.
Docker Commands
Docker Compose
yaml
buildCommand: docker compose up -d --buildDirect Docker
yaml
buildCommand: |
docker build -t myapp . &&
docker stop myapp || true &&
docker rm myapp || true &&
docker run -d --name myapp -p 3000:3000 myappMulti-stage Builds
yaml
buildCommand: |
docker build -t myapp:latest -t myapp:$(git rev-parse --short HEAD) . &&
docker-compose up -dPM2 Commands
PM2 projects automatically restart the process after running the build command.
Build and Restart
yaml
buildCommand: npm install && npm run buildCustom Deployment
yaml
buildCommand: |
npm ci
npm run lint
npm run test
npm run buildStatic Site Commands
For static sites, build commands typically generate the site.
Hugo
yaml
buildCommand: hugo --minifyNext.js Static Export
yaml
buildCommand: npm run build && npm run exportEnvironment Variables
Pass environment variables to build commands:
yaml
buildCommand: ENV_VAR=value docker compose up -d --buildPre/Post Commands
For complex workflows, use shell scripts:
yaml
buildCommand: ./scripts/deploy.shWhere deploy.sh contains:
bash
#!/bin/bash
npm install
npm run build
docker compose up -d --build