frontend/.woodpecker/pipeline.yaml
2025-10-26 21:45:53 -03:00

50 lines
1.2 KiB
YAML

# .woodpecker.yml
# Run pipeline on pushes to main and pull requests
when:
event: [push, pull_request]
branch: [main, develop, feat/*, feature/*]
# Define environment variables
environment:
NODE_ENV: production
# Pipeline steps
steps:
# Install dependencies
- name: install
image: node:18-alpine
commands:
- echo "🔧 Installing dependencies..."
- npm ci --silent
when:
event: [push, pull_request]
# Build application
- name: build
image: node:18-alpine
commands:
- echo "🏗️ Building application..."
- npm run build
when:
event: [push, pull_request]
- name: docker-build
image: docker:24
privileged: true
environment:
DOCKER_REGISTRY: git.badger-pirarucu.ts.net
DOCKER_USER: ${DOCKER_USER}
DOCKER_PASSWORD: ${DOCKER_PASSWORD}
IMAGE_NAME: ${DOCKER_REGISTRY}/username/nextjs-app
commands:
- echo "Logging into Gitea Docker registry..."
- echo $DOCKER_PASSWORD | docker login $DOCKER_REGISTRY -u $DOCKER_USER --password-stdin
- echo "Building Docker image..."
- docker build -t $IMAGE_NAME:latest .
- echo "Pushing Docker image..."
- docker push $IMAGE_NAME:latest
when:
event: [push]