From 734adbb5ae6b0f7da1ba02061307aa9b2817e228 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 20:28:12 +0530 Subject: [PATCH 01/15] refactor: remove unwanted imports --- frontend/src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/App.js b/frontend/src/App.js index 1944224..2fc2bac 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"; From 5accb6fc615e51de13ff6184af5c9bb3e21be9de Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 20:28:50 +0530 Subject: [PATCH 02/15] refactor: add title to iframes --- frontend/src/App.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.js b/frontend/src/App.js index 2fc2bac..5d83546 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -23,14 +23,14 @@ function App({ schedule, empty_schedule }) { if (loading) return (
- +
Chillzone is loading
); else if (!show) return (
- +
Please connect to IIT Kharagpur campus network to access this site!
From d17f6921ea1fe972614de74b2a4e12cfae55d0cc Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 20:29:43 +0530 Subject: [PATCH 03/15] feat: added CI test for PR on master --- .github/workflows/nodejs-pr.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/nodejs-pr.yml diff --git a/.github/workflows/nodejs-pr.yml b/.github/workflows/nodejs-pr.yml new file mode 100644 index 0000000..1f72bb1 --- /dev/null +++ b/.github/workflows/nodejs-pr.yml @@ -0,0 +1,38 @@ +name: Build and Cache Node.js Application + +on: + pull_request: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + 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 + From 8054134d38b55267c971f8ee4eada84060edca72 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 20:31:13 +0530 Subject: [PATCH 04/15] feat: added github action for deployment --- .github/workflows/nodejs-deploy.yml | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/nodejs-deploy.yml diff --git a/.github/workflows/nodejs-deploy.yml b/.github/workflows/nodejs-deploy.yml new file mode 100644 index 0000000..9ccbaf7 --- /dev/null +++ b/.github/workflows/nodejs-deploy.yml @@ -0,0 +1,40 @@ +name: Build and Cache Node.js Application + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + 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: Deploy the application + run: cd frontend && pnpm run deploy \ No newline at end of file From d8086473e9392ca4e8562c4aa745245eca86aefc Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 21:16:10 +0530 Subject: [PATCH 05/15] chore(ci): suggested changes to workflow file --- .github/workflows/build-ci-test.yaml | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build-ci-test.yaml diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml new file mode 100644 index 0000000..38a012e --- /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@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + 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: build/ + From 5e026bb2c902c0656d7a9d3706944d73940df447 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 21:40:05 +0530 Subject: [PATCH 06/15] fix: location of build file and version of checkout --- .github/workflows/build-ci-test.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml index 38a012e..048b640 100644 --- a/.github/workflows/build-ci-test.yaml +++ b/.github/workflows/build-ci-test.yaml @@ -14,10 +14,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 22.2.0 @@ -50,5 +50,5 @@ jobs: uses: actions/upload-artifact@v4 with: name: build - path: build/ + path: ./frontend/build/ From 1a73860ede446624bc61f646c809e4f0e5c213d4 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 21:42:18 +0530 Subject: [PATCH 07/15] feat: added github deployment from artifacts --- .github/workflows/deploy-gh-pages.yaml | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/deploy-gh-pages.yaml diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml new file mode 100644 index 0000000..a4c7a2e --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yaml @@ -0,0 +1,27 @@ +name: Build and Cache Node.js Application + +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: ./build + + - name: Push to deployment + uses: EndBug/add-and-commit@v9 + with: + add: ./build + default_author: user_info + message: 'Updates' \ No newline at end of file From ca2d4a720ac238819e6b34ce170350ee66192747 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 21:42:49 +0530 Subject: [PATCH 08/15] fix: renamed files --- .github/workflows/nodejs-deploy.yml | 40 ----------------------------- .github/workflows/nodejs-pr.yml | 38 --------------------------- 2 files changed, 78 deletions(-) delete mode 100644 .github/workflows/nodejs-deploy.yml delete mode 100644 .github/workflows/nodejs-pr.yml diff --git a/.github/workflows/nodejs-deploy.yml b/.github/workflows/nodejs-deploy.yml deleted file mode 100644 index 9ccbaf7..0000000 --- a/.github/workflows/nodejs-deploy.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build and Cache Node.js Application - -on: - push: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - 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: Deploy the application - run: cd frontend && pnpm run deploy \ No newline at end of file diff --git a/.github/workflows/nodejs-pr.yml b/.github/workflows/nodejs-pr.yml deleted file mode 100644 index 1f72bb1..0000000 --- a/.github/workflows/nodejs-pr.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build and Cache Node.js Application - -on: - pull_request: - branches: - - master - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - 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 - From f0f8da127f7f8d3b160080cc7c66606f84484aac Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 21:43:54 +0530 Subject: [PATCH 09/15] fix: remove semi-colon --- .github/workflows/build-ci-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml index 048b640..e504a66 100644 --- a/.github/workflows/build-ci-test.yaml +++ b/.github/workflows/build-ci-test.yaml @@ -23,7 +23,7 @@ jobs: - name: Install pnpm run: | - cd frontend; + cd frontend npm install -g pnpm - name: Cache pnpm store From df1e618df8113b3b5f427e3ca6a2251ff8f90380 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:02:23 +0530 Subject: [PATCH 10/15] feat: updated to use upload-pages-artifat --- .github/workflows/build-ci-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml index e504a66..5f6a5a5 100644 --- a/.github/workflows/build-ci-test.yaml +++ b/.github/workflows/build-ci-test.yaml @@ -47,7 +47,7 @@ jobs: - name: Save build artifacts if: success() - uses: actions/upload-artifact@v4 + uses: actions/upload-pages-artifact@v4 with: name: build path: ./frontend/build/ From a59e8be9fb0058423e91c5ca2700d7b355f2b283 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:03:15 +0530 Subject: [PATCH 11/15] feat: updated deployment code --- .github/workflows/deploy-gh-pages.yaml | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index a4c7a2e..6f7aa8b 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -6,22 +6,19 @@ on: - master jobs: - build: - runs-on: ubuntu-latest + deploy: - steps: - - name: Checkout code - uses: actions/checkout@v4 + permissions: + pages: write + id-token: write - - name: Download Artifacts - uses: actions/download-artifact@v4 - with: - name: build - path: ./build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 - - name: Push to deployment - uses: EndBug/add-and-commit@v9 - with: - add: ./build - default_author: user_info - message: 'Updates' \ No newline at end of file From dbf0a0b49f2616fccdd66acce996f030e7306dc5 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:07:12 +0530 Subject: [PATCH 12/15] feat: reset to upload-artifacts --- .github/workflows/build-ci-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ci-test.yaml b/.github/workflows/build-ci-test.yaml index 5f6a5a5..e504a66 100644 --- a/.github/workflows/build-ci-test.yaml +++ b/.github/workflows/build-ci-test.yaml @@ -47,7 +47,7 @@ jobs: - name: Save build artifacts if: success() - uses: actions/upload-pages-artifact@v4 + uses: actions/upload-artifact@v4 with: name: build path: ./frontend/build/ From 11a8dfb8e0956a711bb0bd601028a452eb6829f9 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:08:51 +0530 Subject: [PATCH 13/15] feat: deploy to gh pages --- .github/workflows/deploy-gh-pages.yaml | 27 +++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 6f7aa8b..30ab78e 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -6,19 +6,20 @@ on: - master jobs: - deploy: - - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - + build: runs-on: ubuntu-latest + steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 + - 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 From 7834c6e8be4ddede4459032adf1f5b42552598de Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:14:28 +0530 Subject: [PATCH 14/15] Update .github/workflows/deploy-gh-pages.yaml Co-authored-by: Arpit Bhardwaj --- .github/workflows/deploy-gh-pages.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index 30ab78e..bc7fc32 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -21,5 +21,5 @@ jobs: - name: Push to deployment run: | - cd frontend - pnpm run deploy \ No newline at end of file + cd frontend + pnpm run deploy \ No newline at end of file From 006c002cd8d16ab8f74b5c0efab3b50488ec6049 Mon Sep 17 00:00:00 2001 From: Bikram Ghuku Date: Sun, 9 Jun 2024 22:14:43 +0530 Subject: [PATCH 15/15] Update .github/workflows/deploy-gh-pages.yaml Co-authored-by: Arpit Bhardwaj --- .github/workflows/deploy-gh-pages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml index bc7fc32..4d94f52 100644 --- a/.github/workflows/deploy-gh-pages.yaml +++ b/.github/workflows/deploy-gh-pages.yaml @@ -1,4 +1,4 @@ -name: Build and Cache Node.js Application +name: Deploy to Github Pages on: push: