fix CI/CD file #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Oqtepalavash server | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
deploy: | |
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 | |
- name: Deploy to server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
password: ${{ secrets.SERVER_PASSWORD }} | |
key: ${{ secrets.SECRET_KEY_GITHUB }} | |
# port: ${{ secrets.PORT }} | |
script: | | |
cd /var/www/oqtepalavash/backend | |
git pull | |
source venv/bin/activate | |
pip install -r requirements.txt | |
systemctl restart oqtepalavash.service | |
systemctl reload nginx.service | |