Skip to content

update some actions #280

update some actions

update some actions #280

Workflow file for this run

name: Django CI/CD Workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
package-job:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.x
deploy-job:
runs-on: ubuntu-latest
needs: [ package-job ]
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Deploy
if: ${{ job.status != 'failure' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
key: ${{ secrets.SECRET_KEY_GITHUB }}
script: |
cd /var/www/oqtepalavash/backend
git add oqtepa.sqlite3 media/*
git commit -m "update database"
git push
git pull
source venv/bin/activate
pip install -r requirements.txt
systemctl restart backend.service
systemctl reload nginx.service
- name: Stop Workflow on Error
if: ${{ job.status == 'failure' }}
run: exit 1