Skip to content

Commit

Permalink
Merge pull request #67 from Bikram-ghuku/master
Browse files Browse the repository at this point in the history
Added  Automatic deployment of frontend
  • Loading branch information
proffapt authored Jun 9, 2024
2 parents 3cc4e35 + 006c002 commit 2ba9387
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 3 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build-ci-test.yaml
Original file line number Diff line number Diff line change
@@ -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/

25 changes: 25 additions & 0 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -23,14 +23,14 @@ function App({ schedule, empty_schedule }) {
if (loading)
return (
<div className="message-banner">
<iframe src="https://lottie.host/?file=ca9a3787-e6db-4878-a0d3-d10dde95b225/MjnHw4B5gw.json"></iframe>
<iframe src="https://lottie.host/?file=ca9a3787-e6db-4878-a0d3-d10dde95b225/MjnHw4B5gw.json" title="cat-1"></iframe>
<div className="message">Chillzone is loading</div>
</div>
);
else if (!show)
return (
<div className="message-banner">
<iframe src="https://lottie.host/?file=46b58d32-043e-4268-94cd-4d7817565000/xNnhIYFoYA.json"></iframe>
<iframe src="https://lottie.host/?file=46b58d32-043e-4268-94cd-4d7817565000/xNnhIYFoYA.json" title="cat-2"></iframe>
<div className="message">
Please connect to IIT Kharagpur campus network to access this site!
</div>
Expand Down

0 comments on commit 2ba9387

Please sign in to comment.