-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.54 KB
/
deploy-frontend.yml
File metadata and controls
52 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy Frontend
on:
push:
branches:
- main # O la rama principal de tu proyecto
jobs:
deploy-frontend:
name: Deploy Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: List files after checkout
run: ls -R
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # O la versión que estés usando
- name: Install dependencies nad set env file
run: |
npm install
npm run set-env
working-directory: ./Code/infochange/client
- name: Build frontend
run: npm run build
working-directory: ./Code/infochange/client
- name: Set up Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Sync frontend folder to prod-frontend
run: |
git clone --single-branch --branch prod-frontend https://x-access-token:${{ secrets.ANT_GITHUB_TOKEN }}@github.com/${{ github.repository }} prod-frontend
rm -r prod-frontend/*
cp -r ./Code/infochange/client/dist/* prod-frontend/
cd prod-frontend
ls -la
git add -A # Agrega todos los cambios al índice
git status # Opcional: Muestra el estado de Git para depuración
git commit -m "Update frontend deployment" || echo "No changes to commit"
git push origin prod-frontend