Skip to content

Commit 06508b2

Browse files
committed
Merge develop into feature/nycMerge branch 'develop' of https://github.com/pirogramming/Moodico into feature/nyc
2 parents c1b68ec + 78f537a commit 06508b2

32 files changed

Lines changed: 2588 additions & 10910 deletions

.github/workflows/deploy.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Moodico Server
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: ["main", "main-test"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
concurrency:
11+
group: deploy-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
test:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.12"]
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: "pip"
28+
29+
- name: Install dependencies
30+
run: |
31+
python -m pip install --upgrade pip
32+
pip install -r requirements.txt
33+
34+
- name: Run tests
35+
run: |
36+
python manage.py test
37+
38+
deploy:
39+
runs-on: ubuntu-latest
40+
needs: test
41+
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main-test')) || github.event_name == 'workflow_dispatch'
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Deploy to server
46+
uses: appleboy/ssh-action@v1.0.3
47+
with:
48+
host: ${{ secrets.HOST }}
49+
username: ubuntu
50+
key: ${{ secrets.KEY }}
51+
script: |
52+
set -e
53+
BRANCH="${{ github.ref_name }}"
54+
echo "Deploying branch: $BRANCH"
55+
56+
sudo chown -R ubuntu:ubuntu /home/ubuntu/Moodico
57+
sudo git config --system --add safe.directory /home/ubuntu/Moodico
58+
59+
cd /home/ubuntu/Moodico
60+
git fetch origin "$BRANCH"
61+
git reset --hard "origin/$BRANCH"
62+
63+
source venv/bin/activate
64+
pip install --upgrade pip
65+
pip install -r requirements.txt
66+
python manage.py migrate --noinput
67+
python manage.py collectstatic --noinput
68+
69+
sudo systemctl restart gunicorn
70+
sudo systemctl reload nginx

clustering/generate_clusters.py

Lines changed: 0 additions & 119 deletions
This file was deleted.

crawler/color_extract.py

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)