diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e3328c100..03e9d64ebd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,23 +4,41 @@ on: push: branches: - main + pull_request: + branches: + - main jobs: deploy: runs-on: ubuntu-latest + # Checkout the code steps: - name: Checkout Repository uses: actions/checkout@v2 + # Setup NodeJS - name: Install Node.js uses: actions/setup-node@v2 with: node-version: 18 + # Install dependencies - name: Install Dependencies run: npm install + # Run lint checks + - name: Run lint checks + run: npm run lint + + # Run type checks + - name: Run type checks + run: npm run type-check + + # code formatting with Prettier + - name: Check code formatting + run: npm run prettier-check + - name: Build run: npm run build diff --git a/README.md b/README.md index 712f08fe04..f19de17b92 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ * [Introduction](#introduction) * [Features](#features) * [Installation](#installation) +* [Continuous Integration (CI)](#continuous_integration) * [Usage](#usage) * [Contributing](#contribution) @@ -31,6 +32,32 @@ To set up the CNCG Delhi website locally, following are the steps: `npm install` * Start the development server: `npm run dev` + +## Continuous Integration (CI) + +Our repository uses GitHub Actions to automate code validation and build processes. + +### Workflow Details +1. **Lint Checks:** Ensures code quality and detects issues using ESLint. +2. **Type Checks:** Verifies TypeScript types to prevent runtime errors. +3. **Code Formatting:** Checks adherence to the Prettier style guide. +4. **Build Validation:** Confirms that the project builds successfully without errors. + +### Trigger +The workflow runs automatically: +- On every push to the `main` branch. +- On every pull request targeting the `main` branch. + +### Failing Workflow +If any step fails, the workflow blocks the merge until the issue is resolved. Ensure all checks pass before merging. + +### Commands for Local Validation +Run the following commands locally before pushing code: +- `npm run lint` +- `npm run type-check` +- `npm run prettier-check` +- `npm run build` + ## Usage The CNCG Delhi website is designed to be user-friendly. Simply navigate through the menu options to explore different sections of the website. You can register for membership, browse upcoming events, access resources, and engage with the community through forums. diff --git a/package.json b/package.json index 56225dfbe3..90f9f94e92 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,8 @@ "scripts": { "dev": "vite", "build": "tsc && vite build --base=./", + "type-check": "tsc --noEmit", + "prettier-check": "prettier --check .", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "predeploy": "npm run build", diff --git a/src/Sections/Sponsors.tsx b/src/Sections/Sponsors.tsx index ddb7bdd9b3..b5e9950db2 100644 --- a/src/Sections/Sponsors.tsx +++ b/src/Sections/Sponsors.tsx @@ -1,6 +1,8 @@ import "./Card.css"; -import devtron from "../images/devtron.png"; -import microsoft from "../images/microsoft.png"; +// import devtron from "../images/devtron.png"; +import devtron from "../images/new_devtron.png" +// import microsoft from "../images/microsoft.png"; +import microsoft from "../images/new-microsoft.png"; import tata from "../images/tata 1 mg.png"; import epam from "../images/epam.png"; export const Sponsors = () => { @@ -15,10 +17,10 @@ export const Sponsors = () => {
- +
- +
diff --git a/src/images/new-microsoft.png b/src/images/new-microsoft.png new file mode 100644 index 0000000000..79e8a97b2f Binary files /dev/null and b/src/images/new-microsoft.png differ diff --git a/src/images/new_devtron.png b/src/images/new_devtron.png new file mode 100644 index 0000000000..191026c11c Binary files /dev/null and b/src/images/new_devtron.png differ