Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recruiter signup #152

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.git/
.gitignore
.next/
.dockerignore
Dockerfile
node_modules/
.git/
.gitignore
.next/
.dockerignore
Dockerfile
node_modules/
docker-compose.yml
6 changes: 3 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "next/core-web-vitals"
}
{
"extends": "next/core-web-vitals"
}
38 changes: 19 additions & 19 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: build-test

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build-lint-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: "yarn.lock"
- run: yarn
- run: yarn build
name: build-test
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build-lint-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: "yarn.lock"
- run: yarn
- run: yarn build
128 changes: 64 additions & 64 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
name: Publish Frontend Image

on:
release:
types:
- published
workflow_dispatch:

env:
DOCKER_REPO: lofowebteam/tpc_portal_frontend

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKER_REPO }}:${{ github.sha }},${{ env.DOCKER_REPO }}:latest
cache-from: type=registry,ref=${{ env.DOCKER_REPO }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_REPO }}:buildcache,mode=max

bump_tag:
name: Bump tag into docker-compose.yml
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: Checkout charts
uses: actions/checkout@v4
with:
repository: Web-Team-IITI-Gymkhana/tpc-pipeline-testing
ref: "main"
token: ${{ secrets.TPC_GITHUB_ACTION_ADMIN }}
path: base_dir

- name: Changing Chart version
uses: mikefarah/[email protected]
with:
cmd: yq -i '.services.frontend.image = "${{ env.DOCKER_REPO }}:${{ github.sha }}"' base_dir/docker-compose.yml

- name: Commit updated docker compose
run: |
cd base_dir
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add docker-compose.yml
git commit -m "[CI] Bump frontend image tag to ${{ github.sha }}"
git push
name: Publish Frontend Image
on:
release:
types:
- published
workflow_dispatch:
env:
DOCKER_REPO: lofowebteam/tpc_portal_frontend
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKER_REPO }}:${{ github.sha }},${{ env.DOCKER_REPO }}:latest
cache-from: type=registry,ref=${{ env.DOCKER_REPO }}:buildcache
cache-to: type=registry,ref=${{ env.DOCKER_REPO }}:buildcache,mode=max
bump_tag:
name: Bump tag into docker-compose.yml
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: Checkout charts
uses: actions/checkout@v4
with:
repository: Web-Team-IITI-Gymkhana/tpc-pipeline-testing
ref: "main"
token: ${{ secrets.TPC_GITHUB_ACTION_ADMIN }}
path: base_dir
- name: Changing Chart version
uses: mikefarah/[email protected]
with:
cmd: yq -i '.services.frontend.image = "${{ env.DOCKER_REPO }}:${{ github.sha }}"' base_dir/docker-compose.yml
- name: Commit updated docker compose
run: |
cd base_dir
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add docker-compose.yml
git commit -m "[CI] Bump frontend image tag to ${{ github.sha }}"
git push
50 changes: 25 additions & 25 deletions .github/workflows/push-to-server.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
name: Push To Server

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
name: deploy on remote
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.DC_HOST }}
username: ${{ secrets.DC_USER }}
password: ${{ secrets.DC_PASS }}
script: |
cd ~/tpc_portal/tpc-frontend
git pull origin main
docker stop tpc_portal-frontend-1
docker rm tpc_portal-frontend-1
docker rmi tpc_portal-frontend || true
cd ..
docker compose up -d
name: Push To Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: deploy on remote
steps:
- uses: appleboy/[email protected]
with:
host: ${{ secrets.DC_HOST }}
username: ${{ secrets.DC_USER }}
password: ${{ secrets.DC_PASS }}
script: |
cd ~/tpc_portal/tpc-frontend
git pull origin main
docker stop tpc_portal-frontend-1
docker rm tpc_portal-frontend-1
docker rmi tpc_portal-frontend || true
cd ..
docker compose up -d
72 changes: 36 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
.env
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# next.js
/.next/
/out/
# production
/build
# misc
.DS_Store
*.pem
# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# local env files
.env*.local
# vercel
.vercel
# typescript
*.tsbuildinfo
next-env.d.ts
.env
6 changes: 3 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Ignore artifacts:
build
coverage
# Ignore artifacts:
build
coverage
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
FROM node:alpine

WORKDIR /usr/app

COPY ./package.json ./
COPY ./yarn.lock ./

RUN yarn install --frozen-lockfile

COPY ./ ./

RUN yarn build

USER node

FROM node:alpine
WORKDIR /usr/app
COPY ./package.json ./
COPY ./yarn.lock ./
RUN yarn install --frozen-lockfile
COPY ./ ./
RUN yarn build
USER node
CMD [ "yarn", "start" ]
Loading