Some checks failed
Build and Deploy Backend / build_and_deploy (push) Failing after 15s
62 lines
1.5 KiB
YAML
62 lines
1.5 KiB
YAML
name: Build and Deploy Backend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# paths:
|
|
# - "backend/**"
|
|
# - "pyproject.toml"
|
|
# - "uv.lock"
|
|
# - "deploy/deploy-backend.sh"
|
|
|
|
jobs:
|
|
build_and_deploy:
|
|
runs-on: roadrunner
|
|
|
|
container:
|
|
image: python:3.12-bookworm
|
|
|
|
volumes:
|
|
- /opt/blauwasser-api:/opt/blauwasser-api
|
|
- /var/lib/blauwasser-api:/var/lib/blauwasser-api
|
|
|
|
steps:
|
|
- name: Repository auschecken
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Python einrichten
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
# - name: Backend testen
|
|
# working-directory: backend
|
|
# run: |
|
|
# python -m pip install -U pip
|
|
# python -m pip install -e .
|
|
# pytest
|
|
|
|
- name: Backend kopieren
|
|
run: |
|
|
rsync -a --delete \
|
|
--exclude '.venv' \
|
|
--exclude '__pycache__' \
|
|
--exclude '*.db' \
|
|
backend/ /opt/blauwasser-api/backend/
|
|
cp pyproject.toml /opt/blauwasser-api/
|
|
cp uv.lock /opt/blauwasser-api/
|
|
|
|
- name: Abhängigkeiten aktualisieren
|
|
run: |
|
|
cd /opt/blauwasser-api
|
|
uv sync --frozen
|
|
|
|
- name: Backend neu starten
|
|
run: |
|
|
systemctl restart blauwasser-api
|
|
systemctl is-active --quiet blauwasser-api
|
|
|
|
- name: Deployment prüfen
|
|
run: |
|
|
curl --fail https://api.blauwasser-mausis.de/health
|