Agrega dependencia de test al paso de build #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy React App | |
on: | |
push: | |
branches: | |
- new-web | |
path: | |
- .github/workflows/web.yml | |
jobs: | |
web-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout código fuente | |
uses: actions/checkout@v2 | |
- name: Configurar Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Instalar dependencias | |
run: npm install | |
working-directory: ./web | |
- name: Ejecutar los test | |
run: npm run test | |
working-directory: ./web | |
web-build: | |
runs-on: ubuntu-latest | |
needs: web-test | |
steps: | |
- name: Checkout código fuente | |
uses: actions/checkout@v2 | |
- name: Configurar Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 14 | |
- name: Instalar dependencias | |
run: npm install | |
working-directory: ./web | |
- name: Compilar la aplicación | |
run: npm run build | |
working-directory: ./web | |
- name: Publicar artefactos | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: web/build |