Files

61 lines
1.6 KiB
YAML
Raw Permalink Normal View History

---
kind: pipeline
type: docker
name: freelancer-match-ci
steps:
- name: backend-tests
image: python:3.12-slim
commands:
- pip install pytest pytest-asyncio aiosqlite httpx
- cd backend && pytest tests/ -v
- name: frontend-lint
image: node:20-alpine
commands:
- cd frontend && npm ci
- npx next lint --dir app
- name: build-backend
image: docker:24.0
privileged: true
environment:
DOCKER_USERNAME:
from_secret: gitea_username
DOCKER_PASSWORD:
from_secret: gitea_password
commands:
- echo "$DOCKER_PASSWORD" | docker login ms.webhop.me -u "$DOCKER_USERNAME" --password-stdin
- cd backend && docker build -t ms.webhop.me/admin/freelancer-match-backend .
- name: build-frontend
image: docker:24.0
privileged: true
environment:
DOCKER_USERNAME:
from_secret: gitea_username
DOCKER_PASSWORD:
from_secret: gitea_password
commands:
- echo "$DOCKER_PASSWORD" | docker login ms.webhop.me -u "$DOCKER_USERNAME" --password-stdin
- cd frontend && docker build -t ms.webhop.me/admin/freelancer-match-frontend .
- name: deploy
image: alpine:3.19
commands:
- apk add curl bash
- |
echo "Deploying to production..."
# TODO: Добавить SSH ключ для деплоя на сервер
# ssh root@ms.webhop.me "cd /opt/gitea && docker compose pull && docker compose up -d"
---
kind: secret
name: gitea_username
from_secret: drone_gitea_user
---
kind: secret
name: gitea_password
from_secret: drone_gitea_pass