Skip to content

Commit

Permalink
feat: add github workflow for frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Drbohlav committed Mar 2, 2025
1 parent d01d8af commit f9c6d2d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Workflow

on:
pull_request:
types: [synchronize, opened, reopened]
paths:
- "frontend/**"

defaults:
run:
working-directory: frontend
jobs:
runs-on: ubuntu-latest

jobs:
build:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm install

- name: Build Vite React app
run: npm run build

lint:
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Cache node_modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('frontend/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Run ESLint
run: npm run lint

- name: Run Prettier
run: npm run prettier:check
2 changes: 1 addition & 1 deletion frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import reactRefresh from 'eslint-plugin-react-refresh';
import prettier from 'eslint-config-prettier';

export default [
{ ignores: ['dist'] },
{ ignores: ['dist', 'node_modules'] },
{
files: ['**/*.{js,jsx}'],
languageOptions: {
Expand Down

0 comments on commit f9c6d2d

Please sign in to comment.