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
42 changes: 42 additions & 0 deletions .github/workflows/deploy-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy Backend to Render

on:
push:
branches: [ main ]
paths:
- 'backend/**'

env:
NODE_VERSION: '18'

jobs:
deploy-backend:
name: Deploy Backend to Render
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: backend/package-lock.json

- name: Install backend dependencies
working-directory: ./backend
run: npm ci

- name: Test backend
working-directory: ./backend
run: npm run lint
continue-on-error: true

- name: Deploy to Render
run: |
curl -X POST "https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/deploys" \
-H "Authorization: Bearer ${{ secrets.RENDER_API_KEY }}" \
-H "Content-Type: application/json" \
-d '{"clearCache": "do_not_clear"}'
42 changes: 42 additions & 0 deletions .github/workflows/deploy-heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Deploy to Heroku

on:
push:
branches: [ main ]

env:
NODE_VERSION: '18'

jobs:
deploy-heroku:
name: Deploy to Heroku
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Install dependencies
run: |
cd backend && npm ci
cd ../frontend && npm ci

- name: Build frontend
working-directory: ./frontend
run: npm run build
env:
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}

- name: Deploy to Heroku
uses: akhileshns/heroku-deploy@v3.12.14
with:
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
heroku_email: ${{ secrets.HEROKU_EMAIL }}
appdir: "backend"
70 changes: 70 additions & 0 deletions .github/workflows/deploy-vercel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy to Vercel

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
NODE_VERSION: '18'

jobs:
deploy-frontend:
name: Deploy Frontend to Vercel
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: frontend/package-lock.json

- name: Install frontend dependencies
working-directory: ./frontend
run: npm ci

- name: Build frontend
working-directory: ./frontend
run: npm run build
env:
NEXT_PUBLIC_API_BASE_URL: ${{ secrets.NEXT_PUBLIC_API_BASE_URL }}

- 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'

deploy-backend:
name: Deploy Backend to Render
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: backend/package-lock.json

- name: Install backend dependencies
working-directory: ./backend
run: npm ci

- name: Deploy to Render
run: |
curl -X POST "https://api.render.com/v1/services/${{ secrets.RENDER_SERVICE_ID }}/deploys" \
-H "accept: application/json" \
-H "authorization: Bearer ${{ secrets.RENDER_API_KEY }}"
191 changes: 0 additions & 191 deletions .github/workflows/test.yml

This file was deleted.

5 changes: 5 additions & 0 deletions backend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NASA API Configuration
NASA_API_KEY=e11D0lF3vt5BxMiUKDwwnxqLduPAAk053OiLdGIY
PORT=4000
NODE_ENV=development
CORS_ORIGIN=http://localhost:3000
1 change: 1 addition & 0 deletions backend/Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node server.js
Loading
Loading