Skip to content

change to different approach #7

change to different approach

change to different approach #7

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: Configure SSH
run: |

Check failure on line 32 in .github/workflows/django.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/django.yml

Invalid workflow file

You have an error in your yaml syntax on line 32
mkdir -p ~/.ssh/
echo "$SSH_KEY" > ~/.ssh/production.key
chmod 600 ~/.ssh/production.key
cat >>~/.ssh/config <<END
Host production
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/production.key
StrictHostKeyChecking no
END
env:
SSH_USER: ${{ secrets.STAGING_SSH_USER }}
SSH_KEY: ${{ secrets.STAGING_SSH_KEY }}
SSH_HOST: ${{ secrets.STAGING_SSH_HOST }}
- name: Deploy to Server
run: |
ssh production '
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
'