Skip to content

Merge pull request #343 from uwblueprint/navraj/admin_announcements_r… #44

Merge pull request #343 from uwblueprint/navraj/admin_announcements_r…

Merge pull request #343 from uwblueprint/navraj/admin_announcements_r… #44

Workflow file for this run

name: Deploy to Railway
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18.18.2'
cache: 'yarn'
- name: Install dependencies
run: |
cd backend && yarn install
cd ../frontend && yarn install
- name: Generate Prisma Client
run: |
cd backend
npx prisma generate
- name: Run backend tests
run: |
cd backend
yarn lint
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_db
- name: Run frontend tests
run: |
cd frontend
yarn lint
deploy:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Deploy to Railway
uses: railwayapp/railway-deploy@v1
with:
railway-token: ${{ secrets.RAILWAY_TOKEN }}
service: marillac-place