when: branch: main event: push steps: test-backend: image: python:3.11-slim commands: - cd backend - pip install --no-cache-dir -r requirements.txt - pytest app/tests/ -v --tb=short test-frontend: image: node:20-slim commands: - cd frontend - npm ci - npm run build docker-backend: image: woodpeckerci/plugin-docker-buildx depends_on: - test-backend settings: repo: ${CI_FORGE_URL}/${CI_REPO} dockerfile: docker/backend.Dockerfile context: . tag: - latest - ${CI_COMMIT_SHA:0:8} target: production registry: from_secret: docker_registry username: from_secret: docker_username password: from_secret: docker_password docker-frontend: image: woodpeckerci/plugin-docker-buildx depends_on: - test-frontend settings: repo: ${CI_FORGE_URL}/${CI_REPO} dockerfile: docker/frontend.Dockerfile context: . tag: - latest - ${CI_COMMIT_SHA:0:8} target: production registry: from_secret: docker_registry username: from_secret: docker_username password: from_secret: docker_password deploy: image: appleboy/drone-ssh depends_on: - docker-backend - docker-frontend settings: host: from_secret: deploy_host username: from_secret: deploy_username key: from_secret: deploy_key port: 22 script: - cd /opt/glibredecision - docker compose -f docker/docker-compose.yml pull - docker compose -f docker/docker-compose.yml up -d --remove-orphans - docker image prune -f