Skip to content

Commit 3888c73

Browse files
author
MuhammadTahaNasir
committed
Make backend CI generic for template repo
1 parent 4850ea4 commit 3888c73

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/ci-backend.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ on:
77
jobs:
88
backend-test-deploy:
99
runs-on: ubuntu-latest
10-
defaults:
11-
run:
12-
working-directory: server # Change this if your backend folder has a different name or location
1310
steps:
1411
- uses: actions/checkout@v4
12+
1513
- uses: actions/setup-node@v4
1614
with:
1715
node-version: 20
18-
- run: npm install
19-
- run: npm test
20-
- name: Trigger Railway Deploy
16+
17+
- run: npm install || echo "No package.json found, skipping install"
18+
- run: npm test || echo "No tests found, skipping test"
19+
20+
- name: Trigger Railway Deploy (skip if no webhook)
21+
if: secrets.RAILWAY_DEPLOY_HOOK != ''
2122
run: curl -X POST https://backboard.railway.app/webhook/${{ secrets.RAILWAY_DEPLOY_HOOK }}

0 commit comments

Comments
 (0)