Skip to content

PAso de build no usa cache #17

PAso de build no usa cache

PAso de build no usa cache #17

Workflow file for this run

name: Web pipeline
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: Restaurar caché de node_modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
if: steps.test.outputs.cache-hit != 'true'
- name: Instalar dependencias
run: npm install
working-directory: ./web
- name: Ejecutar los test
run: npm run test
working-directory: ./web
- name: Guardar caché de node_modules
id: cache-node-modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
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: Compilar la aplicación
run: |
npm install
npm run build
working-directory: ./web
- name: Publicar artefactos
uses: actions/upload-artifact@v2
with:
name: build
path: web/build
# release:
# needs: web-build
# runs-on: ubuntu-latest
#
# steps:
# - name: Checkout código fuente
# uses: actions/checkout@v2
#
# - name: Crear release
# id: create_release
# uses: softprops/action-gh-release@v1
# with:
# files: web/build/*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}