Skip to content

Added semantic scholar and the basic scoring function implementation #34

Added semantic scholar and the basic scoring function implementation

Added semantic scholar and the basic scoring function implementation #34

Workflow file for this run

name: Deploy FastAPI Application
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Python (latest stable version)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create .env file
run: |
echo "PROXIES=${{ secrets.PROXIES }}" > .env
echo "API_KEYS=${{ secrets.API_KEYS }}" >> .env
- name: Run tests
run: |
export PYTHONPATH=$PWD
pytest tests/
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up Python (latest stable version)
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Checkout code
uses: actions/checkout@v2
- name: Create .env file
run: |
echo "PROXIES=${{ secrets.PROXIES }}" > .env
echo "API_KEYS=${{ secrets.API_KEYS }}" >> .env
- name: Copy repository and .env to the server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
port: 22
source: "."
target: "/var/www/paper_scrapper"
- name: Execute deployment script
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.DEPLOY_KEY }}
debug: true
port: 22
script: |
cd /var/www/paper_scrapper
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
sudo systemctl stop paper_scrapper.service
sudo systemctl enable paper_scrapper.service
sudo systemctl start paper_scrapper.service
sudo systemctl status paper_scrapper.service
- name: Wait for deployment to complete
run: sleep 10