diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml new file mode 100644 index 0000000..e1a3c05 --- /dev/null +++ b/.github/workflows/deployment.yml @@ -0,0 +1,42 @@ +name: Deployment Checks + +on: + push: + branches: + - deploy + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ["3.8", "3.9", "3.10"] + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run code checks + run: | + pip install black + black --check + + - name: Verify code doesn't contain local development references + run: | + if grep -r "127.0.0.1" .; then + echo "Error: Code contains references to local development (127.0.0.1)" + exit 1 + fi + + - name: Validate Gunicorn configuration + run: | + gunicorn -c gunicorn_config.py server:app + env: + ENV_VAR1: ${{ secrets.ENV_VAR1 }} diff --git a/.gitignore b/.gitignore index 19cfbc1..24853df 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ test.db # secret keys report_ai.pem +dev.sh diff --git a/build.sh b/build.sh index 84946d9..64dd1f0 100644 --- a/build.sh +++ b/build.sh @@ -1,3 +1,4 @@ #!/bin/bash - +export API_KEY=APIKEY +export MONGO=MONGOKEY python3 server.py diff --git a/report_ai/background.js b/report_ai/background.js index a6eb7ad..a18d56a 100644 --- a/report_ai/background.js +++ b/report_ai/background.js @@ -1,6 +1,6 @@ chrome.tabs.onActivated.addListener(function (activeInfo) { console.log(activeInfo.tabId); - alert("Tab changed"); + console.log("Tab changed"); const btn4 = document.querySelector("#refreshBtn"); btn4.onclick = () =>{ chrome.tabs.query({active: true, currentWindow: true}, function(tabs) { diff --git a/server.py b/server.py index e552444..5e13705 100644 --- a/server.py +++ b/server.py @@ -13,7 +13,7 @@ import requests -load_dotenv() +load_dotenv(".env") app = Flask(__name__) cors = CORS(app) @@ -147,6 +147,10 @@ def top_ratings(): response = {"top": tops_list} return jsonify(response) +@app.route("/") +def home(): + """Home page""" + return "Server is working, //[REPORT.AI]" if __name__ == "__main__": - app.run(debug=False) + app.run(debug=True)