Skip to content

Merge branch 'dev'

Merge branch 'dev' #34

Workflow file for this run

name: Deploy Django + Vue.js
on:
push:
branches:
- main
jobs:
Update_Code:
runs-on: self-hosted
steps:
- name: Checkout or update code
run: |
cd /home/django/project
if [ -d "./app" ]; then
cd app
git pull origin main
else
git clone https://github.com/HE-Arc/Mind-vs-Wild.git app
fi
Deploy_Django:
runs-on: self-hosted
needs: Update_Code
steps:
- name: Deploy Django backend
run: |
cd /home/django/project/app/api
export PIPENV_VENV_IN_PROJECT=1
export PIPENV_IGNORE_VIRTUALENVS=1
pipenv --rm || true
pipenv --python $(which python3)
pipenv install --deploy --ignore-pipfile
pipenv run python manage.py migrate --noinput
pipenv run python manage.py collectstatic --noinput
Deploy_Frontend:
runs-on: self-hosted
needs: Update_Code
steps:
- name: Deploy Quasar frontend
run: |
cd /home/django/project/app/frontend
npm i
npm run build
echo "Frontend built successfully."
Restart_Services:
runs-on: self-hosted
needs: [Deploy_Django, Deploy_Frontend]
steps:
- name: Restart Gunicorn and Nginx
run: |
sudo systemctl restart gunicorn