diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml new file mode 100644 index 0000000..e504a66 --- /dev/null +++ b/.github/workflows/build-ci-test.yaml @@ -0,0 +1,54 @@ +name: Integration Test (Build) + +on: + pull_request: + types: + - opened + - synchronize + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 22.2.0 + + - name: Install pnpm + run: | + cd frontend + npm install -g pnpm + + - name: Cache pnpm store + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + if: steps.pnpm-cache.outputs.cache-hit != 'true' + run: | + cd frontend + pnpm install + + - name: Build the application + run: | + cd frontend + pnpm run build + + - name: Save build artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: build + path: ./frontend/build/ + diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml new file mode 100644 index 0000000..4d94f52 --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yaml @@ -0,0 +1,25 @@ +name: Deploy to Github Pages + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: build + path: ./frontend/build/ + + - name: Push to deployment + run: | + cd frontend + pnpm run deploy \ No newline at end of file diff --git a/frontend/src/App.js b/frontend/src/App.js index 1944224..5d83546 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -1,4 +1,4 @@ -import React, { Component, useEffect, useState } from "react"; +import React, { useEffect, useState } from "react"; import "./App.css"; import CustomTable from "./CustomTable.js"; import PropTypes from "prop-types"; @@ -23,14 +23,14 @@ function App({ schedule, empty_schedule }) { if (loading) return (