Skip to content

Added ci workflow

Added ci workflow #8

Workflow file for this run

name: Paisable CI
on: [push,pull_request]
jobs:
CI:
runs-on: ubuntu-latest
services:
mongo:
image: mongo:6
ports:
- 27017:27017
options: >-
--health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
PORT: 5000
MONGO_URI: mongodb://mongo:27017/testdb
JWT_SECRET: your-secret-key
GEMINI_API_KEY: your-gemini-api-key
VITE_API_URL: http://localhost:5000/api
steps:
- name: Checkout
uses: actions/checkout@v5.0.0
with:
path: .
- name: Setup Node
uses: actions/setup-node@v5.0.0
- name: Install Backend & Run
run: |
cd backend
npm install
# npm run test
node run dev > server.log 2>&1 &
server_pid=$!
echo "Server started with PID: $server_pid"
for i in {1..15}; do
if curl -fs http://localhost:5000 > /dev/null; then
echo "Server is up!"
kill $server_pid
echo "No issues found!"
exit 0
fi
echo "Waiting for server... (attempt $i/15)"
sleep 2
done
echo "Server failed to start. Printing logs:"
cat server.log
kill $server_pid
- name: Install Frontend & Run
run: |
cd frontend
npm install
# npm run test
npm run build