Skip to content

Commit

Permalink
Merge pull request #29 from gobbledy-gook/patch1
Browse files Browse the repository at this point in the history
Patch1
  • Loading branch information
gobbledy-gook authored Jun 20, 2023
2 parents 3fff28f + 90e70b5 commit 897eaa2
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 4 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ test.db

# secret keys
report_ai.pem
dev.sh
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash

export API_KEY=APIKEY
export MONGO=MONGOKEY
python3 server.py
2 changes: 1 addition & 1 deletion report_ai/background.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
8 changes: 6 additions & 2 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import requests


load_dotenv()
load_dotenv(".env")
app = Flask(__name__)
cors = CORS(app)

Expand Down Expand Up @@ -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)

0 comments on commit 897eaa2

Please sign in to comment.