Skip to content

Commit 88a41ad

Browse files
Update main.yml
1 parent d6adf63 commit 88a41ad

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
run: npm install
3131

3232
- name: Run frontend tests
33+
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
3334
run: npm run test
3435
env:
3536
CI: true
@@ -41,19 +42,17 @@ jobs:
4142
VITE_APP_ID: ${{ secrets.VITE_APP_ID }}
4243

4344
- name: Build frontend
45+
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
4446
run: npm run build
4547
env:
4648
CI: true
4749

4850
- name: Deploy to Vercel
4951
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5052
run: npx vercel --prod --token ${{ secrets.VERCEL_TOKEN }}
51-
# working-directory eliminado para evitar el error
5253
env:
5354
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
5455
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
55-
working-directory: ./client # <- 🚫 Este fue eliminado para evitar /client/client
56-
# ✅ Ya estás en ./client desde `defaults.run`, así que no es necesario repetir
5756

5857
backend:
5958
runs-on: ubuntu-latest
@@ -72,9 +71,8 @@ jobs:
7271
- name: Install backend dependencies
7372
run: npm install
7473

75-
76-
7774
- name: Run backend tests
75+
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
7876
run: npm run test:ci
7977
env:
8078
CI: true
@@ -86,3 +84,13 @@ jobs:
8684
service_id: ${{ secrets.RENDER_SERVICE_ID }}
8785
api_key: ${{ secrets.RENDER_API_KEY }}
8886
clear_cache: false
87+
wait_deploy: true
88+
89+
90+
- name: Comentar en el PR
91+
if: github.event_name == 'pull_request'
92+
uses: marocchino/sticky-pull-request-comment@v2
93+
with:
94+
message: |
95+
✅ ¡Pipeline ejecutado correctamente!
96+
🔧 Se realizaron pruebas y compilación del frontend y backend.

0 commit comments

Comments
 (0)