Skip to content

deactivate steps dependency, test, setup #4

deactivate steps dependency, test, setup

deactivate steps dependency, test, setup #4

Workflow file for this run

name: Django CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9, '3.10']
steps:
- uses: actions/checkout@v4
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v3
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install Dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements/production.txt
# - name: Run Tests
# run: |
# python manage.py test
- name: Deploy to Server
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_USERNAME: ${{ secrets.SSH_USERNAME }}
run: |
echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
ssh-keyscan -H "$SSH_HOST" >> ~/.ssh/known_hosts
ssh $SSH_USERNAME@$SSH_HOST '
cd /home/django/bakeup/ &&
git pull origin main &&
source /home/django/djangoenv/bin/activate &&
pip install -r requirements/production.txt &&
python manage.py migrate &&
python collectstatic --noinput &&
supervisorctl restart django
'