Skip to content

Commit 75df42e

Browse files
committed
cambio en el yml
1 parent c4fb2a3 commit 75df42e

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

.github/workflows/ci.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
name: CI
2+
23
on:
34
pull_request:
45
branches: [ "main" ]
6+
57
jobs:
68
frontend:
79
name: Frontend (Next.js)
810
runs-on: ubuntu-latest
911
defaults:
1012
run:
11-
working-directory: frontend
13+
working-directory: demo # <-- tu app Next.js está en 'demo'
1214
steps:
1315
- uses: actions/checkout@v4
16+
1417
- uses: actions/setup-node@v4
1518
with:
1619
node-version: 20
1720
cache: npm
18-
cache-dependency-path: frontend/package-lock.json
19-
- run: npm ci
20-
- run: npm run lint --if-present
21-
- run: npm run build
21+
cache-dependency-path: demo/package-lock.json
22+
23+
- name: Install deps
24+
run: |
25+
if [ -f package-lock.json ]; then
26+
npm ci
27+
else
28+
npm install
29+
fi
30+
31+
- name: Lint (opcional)
32+
run: npm run lint --if-present
33+
34+
- name: Build
35+
env:
36+
NEXT_TELEMETRY_DISABLED: 1
37+
# Si tu build necesita variables, crea secrets y pásalas aquí.
38+
# EJ: NEXT_PUBLIC_API_URL: ${{ secrets.NEXT_PUBLIC_API_URL }}
39+
run: npm run build
2240

2341
backend:
2442
name: Backend (Gradle)
@@ -28,9 +46,22 @@ jobs:
2846
working-directory: backend
2947
steps:
3048
- uses: actions/checkout@v4
49+
3150
- uses: actions/setup-java@v4
3251
with:
3352
distribution: temurin
34-
java-version: 21
53+
java-version: 17 # usa 17 salvo que tu build.gradle pida 21
54+
3555
- uses: gradle/actions/setup-gradle@v3
36-
- run: ./gradlew build --no-daemon
56+
57+
- name: Grant execute permission for gradlew (si existe)
58+
if: ${{ hashFiles('backend/gradlew') != '' }}
59+
run: chmod +x gradlew
60+
61+
- name: Build con Gradle Wrapper
62+
if: ${{ hashFiles('backend/gradlew') != '' }}
63+
run: ./gradlew build --no-daemon
64+
65+
- name: Build con Gradle (sin wrapper)
66+
if: ${{ hashFiles('backend/gradlew') == '' }}
67+
run: gradle build --no-daemon

0 commit comments

Comments
 (0)