Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,28 @@ jobs:
env:
VITE_BACKEND_URL: http://localhost:5000

docker-build:
name: Docker Build
deploy-frontend:
name: Deploy Frontend
runs-on: ubuntu-latest
needs: [backend-test, frontend-build]
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- uses: actions/checkout@v4

- name: Build backend image
run: docker build -t syswatch-backend ./backend
- name: Deploy to Vercel
uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: ./frontend
vercel-args: '--prod'

- name: Build frontend image
run: docker build --build-arg VITE_BACKEND_URL=http://localhost:5000 -t syswatch-frontend ./frontend
deploy-backend:
name: Deploy Backend
runs-on: ubuntu-latest
needs: [backend-test, frontend-build]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Trigger Render Deploy
run: curl -X POST "${{ secrets.RENDER_DEPLOY_HOOK_URL }}"
4 changes: 2 additions & 2 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
app = Flask(__name__)
app.config['SECRET_KEY'] = 'syswatch-secret-key-change-in-prod'

CORS(app, origins='*')
CORS(app, origins=['https://syswatch-nine.vercel.app'])

socketio = SocketIO(app, cors_allowed_origins='*', async_mode='eventlet')
socketio = SocketIO(app, cors_allowed_origins=['https://syswatch-nine.vercel.app'], async_mode='eventlet')

app.register_blueprint(api_blueprint)
register_handlers(socketio)
Expand Down
2 changes: 2 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ coverage/

# Editor
.DS_Store
.vercel
.env*.local
Loading