File tree Expand file tree Collapse file tree 18 files changed +321
-0
lines changed
Expand file tree Collapse file tree 18 files changed +321
-0
lines changed Original file line number Diff line number Diff line change 1+ # Frontend
2+ NODE_ENV = production
3+
4+ # Backend
5+ NODE_ENV = production
6+ DATABASE_URL = postgresql://postgres:password@db:5432/appdb
Original file line number Diff line number Diff line change 1+ name : AI Project CI
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ test-ai :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v4
10+
11+ - name : Set up Python
12+ uses : actions/setup-python@v5
13+ with :
14+ python-version : ' 3.10'
15+
16+ - name : Install dependencies
17+ run : |
18+ pip install -r requirements.txt
19+
20+ - name : Run Tests
21+ run : pytest
22+
23+ - name : Convert Notebooks to HTML
24+ run : |
25+ mkdir -p html
26+ for notebook in notebooks/*.ipynb; do
27+ jupyter nbconvert --to html "$notebook" --output-dir html
28+ done
29+
30+ - name : Deploy to GitHub Pages
31+ uses : peaceiris/actions-gh-pages@v4
32+ with :
33+ github_token : ${{ secrets.GITHUB_TOKEN }}
34+ publish_dir : ./html
Original file line number Diff line number Diff line change 1+ name : Backend CI & Deploy (Railway)
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ backend-test-deploy :
9+ runs-on : ubuntu-latest
10+ defaults :
11+ run :
12+ working-directory : server
13+ steps :
14+ - uses : actions/checkout@v4
15+ - uses : actions/setup-node@v4
16+ with :
17+ node-version : 20
18+ - run : npm install
19+ - run : npm test
20+ - name : Trigger Railway Deploy
21+ run : curl -X POST https://backboard.railway.app/webhook/${{ secrets.RAILWAY_DEPLOY_HOOK }}
Original file line number Diff line number Diff line change 1+ name : Frontend CI & Deploy (Vercel)
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ build-frontend :
7+ runs-on : ubuntu-latest
8+ defaults :
9+ run :
10+ working-directory : client
11+ steps :
12+ - uses : actions/checkout@v4
13+ - uses : actions/setup-node@v4
14+ with :
15+ node-version : 20
16+
17+ - run : npm install
18+ - run : npm run lint
19+ - run : npm run build
20+
21+ deploy-vercel :
22+ runs-on : ubuntu-latest
23+ needs : build-frontend
24+ steps :
25+ - uses : amondnet/vercel-action@v25
26+ with :
27+ vercel-token : ${{ secrets.VERCEL_TOKEN }}
28+ vercel-org-id : ${{ secrets.VERCEL_ORG_ID }}
29+ vercel-project-id : ${{ secrets.VERCEL_PROJECT_ID }}
30+ working-directory : ./client
Original file line number Diff line number Diff line change 1+ name : Docker Build & Push
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ docker :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ - name : Set up Docker Buildx
13+ uses : docker/setup-buildx-action@v3
14+ - name : Log in to Docker Hub
15+ uses : docker/login-action@v3
16+ with :
17+ username : ${{ secrets.DOCKER_USERNAME }}
18+ password : ${{ secrets.DOCKER_PASSWORD }}
19+
20+ - name : Build & Push Client
21+ uses : docker/build-push-action@v5
22+ with :
23+ context : ./client
24+ push : true
25+ tags : yourdockerhubuser/mern-client:latest
26+
27+ - name : Build & Push Server
28+ uses : docker/build-push-action@v5
29+ with :
30+ context : ./server
31+ push : true
32+ tags : yourdockerhubuser/mern-server:latest
Original file line number Diff line number Diff line change 1+ name : Deploy Static Site to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ - uses : actions/setup-node@v4
13+ with :
14+ node-version : 20
15+ - run : npm install
16+ - run : npm run build
17+ - uses : peaceiris/actions-gh-pages@v4
18+ with :
19+ github_token : ${{ secrets.GITHUB_TOKEN }}
20+ publish_dir : ./build
Original file line number Diff line number Diff line change 1+ name : Deploy to Heroku
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+
13+ - name : Deploy to Heroku
14+ uses : akhileshns/heroku-deploy@v3.12.12
15+ with :
16+ heroku_api_key : ${{ secrets.HEROKU_API_KEY }}
17+ heroku_app_name : your-app-name
18+ heroku_email : your-email@example.com
19+ usedocker : false
Original file line number Diff line number Diff line change 1+ name : Auto Lint & Format
2+
3+ on : [push, pull_request]
4+
5+ jobs :
6+ format :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - uses : actions/checkout@v4
10+ - uses : actions/setup-node@v4
11+ with :
12+ node-version : 20
13+ - run : npm ci
14+ - run : npx prettier --write .
15+ - run : npx eslint . --fix
Original file line number Diff line number Diff line change 1+ name : Deploy to Render
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ trigger :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Trigger Render deploy
12+ run : |
13+ curl -X POST https://api.render.com/deploy/srv-xxxxxxxxxx?key=${{ secrets.RENDER_DEPLOY_KEY }}
Original file line number Diff line number Diff line change 1+ name : Deploy to Private VPS
2+
3+ on :
4+ push :
5+ branches : [main]
6+
7+ jobs :
8+ deploy :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ - name : Set up SSH
13+ run : |
14+ mkdir -p ~/.ssh
15+ echo "${{ secrets.VPS_KEY }}" > ~/.ssh/id_rsa
16+ chmod 600 ~/.ssh/id_rsa
17+ ssh-keyscan -H your.vps.ip >> ~/.ssh/known_hosts
18+
19+ - name : Rsync to VPS
20+ run : rsync -avz --exclude=".git" ./ youruser@your.vps.ip:/var/www/your-app
21+
22+ - name : Restart App on VPS
23+ run : ssh youruser@your.vps.ip 'cd /var/www/your-app && docker-compose up -d --build'
You can’t perform that action at this time.
0 commit comments