Skip to content

.github/workflows/cd.yml #9

.github/workflows/cd.yml

.github/workflows/cd.yml #9

Workflow file for this run

on:
workflow_dispatch:
push:
branches:
- production
jobs:
django:
name: Django build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r backend/requirements.txt
- name: Collect static files
working-directory: ./backend/
run: python manage.py collectstatic
- name: Deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.KEY }}
ARGS: "-rlgoDzvc -i"
SOURCE: "backend/"
TARGET: "/home/${{ secrets.USERNAME }}/backend/"
REMOTE_HOST: ${{ secrets.HOST }}
REMOTE_USER: ${{ secrets.USERNAME }}
REMOTE_PORT: ${{ secrets.PORT }}
SCRIPT_BEFORE: |
rm -rf backend/
mkdir backend/