Skip to content

Commit

Permalink
Merge branch 'prod2' into 162-add-privacy-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
TharunKumarrA authored Oct 15, 2024
2 parents 8dd1e78 + f87a368 commit 68d0199
Show file tree
Hide file tree
Showing 9 changed files with 219 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install
run: npm install --force

- name: Build the Next.js app
run: npm run build
Expand Down
101 changes: 101 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: [ main, prod2 ]
pull_request:
branches: [ main, prod2 ]
workflow_dispatch:

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0
with:
cosign-release: 'v2.2.4'

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64/v8
build-args: |
NEXT_PUBLIC_IS_PRODUCTION=${{ secrets.NEXT_PUBLIC_IS_PRODUCTION }}
NEXT_PUBLIC_PAY_U_KEY_TEST=${{ secrets.NEXT_PUBLIC_PAY_U_KEY_TEST }}
NEXT_PUBLIC_PAY_U_KEY_PROD=${{ secrets.NEXT_PUBLIC_PAY_U_KEY_PROD }}
# Sign the resulting Docker image digest except on PRs.
# This will only write to the public Rekor transparency log when the Docker
# repository is public to avoid leaking data. If you would like to publish
# transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
78 changes: 78 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
FROM node:20-alpine AS base

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm i --force; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi


# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build.
# ENV NEXT_TELEMETRY_DISABLED=1

# Set environment variables needed for build
ARG NEXT_PUBLIC_IS_PRODUCTION
ARG NEXT_PUBLIC_PAY_U_KEY_TEST
ARG NEXT_PUBLIC_PAY_U_KEY_PROD

# Pass them to the build process
ENV NEXT_PUBLIC_IS_PRODUCTION=${NEXT_PUBLIC_IS_PRODUCTION}
ENV NEXT_PUBLIC_PAY_U_KEY_TEST=${NEXT_PUBLIC_PAY_U_KEY_TEST}
ENV NEXT_PUBLIC_PAY_U_KEY_PROD=${NEXT_PUBLIC_PAY_U_KEY_PROD}

RUN \
if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
else echo "Lockfile not found." && exit 1; \
fi

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV=production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3002

ENV PORT=3002

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Trigger vercel 2
Trigger vercel 3

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

Expand Down
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ module.exports = withBundleAnalyzer({
return config;
},

output: "standalone",

experimental: {
serverActions: {
allowedOrigins: [
Expand Down
Binary file added public/images/anokha_image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions src/app/components/SponsorsMarquee.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const SponsorElement = ({ src, title }) => {
? 180
: title == "ICICI"
? 200
: title == "Dhanalakshmi Bank"
? 150
: title == "vnc group"
? 100
: 80
}
width={
Expand All @@ -24,11 +28,13 @@ const SponsorElement = ({ src, title }) => {
? 180
: title == "ICICI"
? 200
// : title == "CISCO"
// ? 140
: title == "Dhanalakshmi Bank"
? 150
: title == "vnc group"
? 100
: 80
}
className={title == "H&R" ? "mr-8 ml-16" : "mx-8"}
className={title == "H&R" ? "mr-4 ml-24" : title == "Dhanalakshmi Bank" ? "mx-20" : "mx-8"}
/>
);
};
Expand All @@ -51,41 +57,56 @@ const SponsorsMarquee = () => {
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>


{/* OneAPI logo */}
<SponsorElement src="https://i.imgur.com/X1qoxbQ.png" title="H&R" />
<SponsorElement src="https://i.imgur.com/5BlpVzJ.jpg" title="IETE" />
{/* <SponsorElement src="https://i.imgur.com/AK9UfYT.png" title="1API" /> */}
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>

<SponsorElement src="https://i.imgur.com/X1qoxbQ.png" title="H&R" />
<SponsorElement src="https://i.imgur.com/5BlpVzJ.jpg" title="IETE" />
{/* <SponsorElement src="https://i.imgur.com/AK9UfYT.png" title="1API" /> */}
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>

<SponsorElement src="https://i.imgur.com/X1qoxbQ.png" title="H&R" />
<SponsorElement src="https://i.imgur.com/5BlpVzJ.jpg" title="IETE" />
{/* <SponsorElement src="https://i.imgur.com/AK9UfYT.png" title="1API" /> */}
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>

<SponsorElement src="https://i.imgur.com/X1qoxbQ.png" title="H&R" />
<SponsorElement src="https://i.imgur.com/5BlpVzJ.jpg" title="IETE" />
{/* <SponsorElement src="https://i.imgur.com/AK9UfYT.png" title="1API" /> */}
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>

<SponsorElement src="https://i.imgur.com/X1qoxbQ.png" title="H&R" />
<SponsorElement src="https://i.imgur.com/5BlpVzJ.jpg" title="IETE" />
{/* <SponsorElement src="https://i.imgur.com/AK9UfYT.png" title="1API" /> */}
{/* <SponsorElement src="https://i.imgur.com/e4TmMGj.jpeg" title="IEEE" /> */}
<SponsorElement src="https://i.imgur.com/0VLpF8v.png" title="ICICI" />
{/* <SponsorElement src="https://i.imgur.com/tP5wEjl.png" title="CISCO" /> */}
<SponsorElement src="https://i.imgur.com/gCTbGOI.png" title="Dhanalakshmi Bank"/>
<SponsorElement src="https://i.imgur.com/7lCblCB.png" title="vnc group"/>

</Marquee>
</div>
);
Expand Down
10 changes: 10 additions & 0 deletions src/app/events/components/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,19 @@ export default function EventCard({
)
?
(
(secureLocalStorage.getItem("isLoggedIn") && isRegistered == "1")
?
(
<button class="transition ease-in duration-300 inline-flex items-center text-sm font-medium bg-white px-5 py-2 hover:shadow-lg tracking-wider text-black rounded-full ">
<span>Registered</span>
</button>
)
:
(
<button class="transition ease-in duration-300 inline-flex items-center text-sm font-medium bg-white px-5 py-2 hover:shadow-lg tracking-wider text-black rounded-full ">
<span>Register</span>
</button>
)
)
:
(
Expand Down
3 changes: 2 additions & 1 deletion src/app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const metadata = {
description: `12th Annual Techfest of Amrita Viswa Vidyapeetham, Coimbatore.`,
favicon: `./favicon.ico`,
icon: `./favicon.ico`,
appleIcon: `./favicon.ico`
appleIcon: `./favicon.ico`,
image: `/images/anokha_image.png`
}

export default function RootLayout({ children }) {
Expand Down

0 comments on commit 68d0199

Please sign in to comment.