diff --git a/.github/workflows/backend_check.yml b/.github/workflows/check_backend.yml similarity index 96% rename from .github/workflows/backend_check.yml rename to .github/workflows/check_backend.yml index 04f16ce..f942902 100644 --- a/.github/workflows/backend_check.yml +++ b/.github/workflows/check_backend.yml @@ -11,7 +11,7 @@ on: - 'backend/pyproject.toml' - 'Dockerfile*' - 'docker-compose*.yml' - - '.github/workflows/backend_check.yml' + - '.github/workflows/check_backend.yml' pull_request: branches: - 'main' @@ -21,7 +21,7 @@ on: - 'backend/pyproject.toml' - 'Dockerfile*' - 'docker-compose*.yml' - - '.github/workflows/backend_check.yml' + - '.github/workflows/check_backend.yml' jobs: @@ -68,7 +68,7 @@ jobs: with: python-version-file: "./backend/pyproject.toml" - - name: Install Black & Ruff with uv + - name: Install Ruff with uv working-directory: ./backend run: | uv sync --only-group ruff diff --git a/.github/workflows/check_frontend.yml b/.github/workflows/check_frontend.yml new file mode 100644 index 0000000..5865f55 --- /dev/null +++ b/.github/workflows/check_frontend.yml @@ -0,0 +1,66 @@ +name: Frontend Check + +on: + push: + branches: + - '*' + - 'main' + paths: + - 'frontend/**.jsx?' + - 'frontend/**.tsx?' + - 'frontend/**.css' + - 'frontend/**.json' + - 'Dockerfile*' + - 'docker-compose*.yml' + - '.github/workflows/check_frontend.yml' + pull_request: + branches: + - 'main' + paths: + - 'frontend/**.jsx?' + - 'frontend/**.tsx?' + - 'frontend/**.css' + - 'frontend/**.json' + - 'Dockerfile*' + - 'docker-compose*.yml' + - '.github/workflows/check_frontend.yml' + +jobs: + npm_prod: + name: Run `npm run prod` in production mode + runs-on: ubuntu-latest + steps: + - name: Check out Git repository + uses: actions/checkout@v4 + + - name: Set-up Node.js according to .nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: frontend/.nvmrc + cache: 'npm' + cache-dependency-path: frontend/package-lock.json + + - name: Cache npm + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install dependencies + working-directory: frontend + run: | + npm ci + +# TODO: Fix ES Lint before enabling this step +# https://eslint.org/docs/latest/use/configure/migration-guide +# - name: Lint the project +# working-directory: frontend +# run: | +# npm run lint + + - name: Build frontend + working-directory: frontend + run: | + npm run prod