Skip to content

Initial web package based on Typescript, React and Vite #89

Initial web package based on Typescript, React and Vite

Initial web package based on Typescript, React and Vite #89

Workflow file for this run

################################################################################
#
# Copyright (C) 2023-2024 retro.ai
# This file is part of retro3 - https://github.com/retroai/retro3
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# See the file LICENSE.txt for more information.
#
################################################################################
name: Node.js CI
on: [push, pull_request]
jobs:
build-and-deploy:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
defaults:
run:
# Set the working directory to frontend folder
working-directory: src/frontend
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-20.04
node-version: 20
- os: ubuntu-22.04
node-version: 21
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Cache vite build files
id: cache-vite
uses: actions/cache@v4
with:
path: |
src/frontend/dist
key: cache-vite-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('src/frontend/**') }}
- name: Cache pnpm modules
id: cache-modules
uses: actions/cache@v4
with:
path: |
src/frontend/node_modules
key: cache-modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('src/frontend/pnpm-lock.yaml') }}
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
run: |
npm install -g pnpm
- name: pnpm install
if: steps.cache-modules.outputs.cache-hit != 'true'
run: |
pnpm install
- name: pnpm audit-ci
run: |
pnpm audit-ci
- name: pnpm lint
if: steps.cache-vite.outputs.cache-hit != 'true'
run: |
pnpm lint
- name: pnpm build
if: steps.cache-vite.outputs.cache-hit != 'true'
run: |
pnpm build