Skip to content

Commit

Permalink
deployment on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeylitvinenko1 committed Feb 18, 2024
1 parent 328d78d commit 56770a9
Show file tree
Hide file tree
Showing 8 changed files with 241 additions and 83 deletions.
106 changes: 83 additions & 23 deletions .github/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,93 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: GitHub Pages deploy
# Sample workflow for building and deploying a Next.js site to GitHub Pages
#
# To get started with Next.js see: https://nextjs.org/docs/getting-started
#
name: Deploy Next.js site to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: [main]
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/[email protected]
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Checkout
uses: actions/checkout@v4
- name: Detect package manager
id: detect-package-manager
run: |
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
echo "manager=yarn" >> $GITHUB_OUTPUT
echo "command=install" >> $GITHUB_OUTPUT
echo "runner=yarn" >> $GITHUB_OUTPUT
exit 0
elif [ -f "${{ github.workspace }}/package.json" ]; then
echo "manager=npm" >> $GITHUB_OUTPUT
echo "command=ci" >> $GITHUB_OUTPUT
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
exit 0
else
echo "Unable to determine package manager"
exit 1
fi
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '16.x'

- name: Installing my packages
run: npm ci

- name: Build my App
run: npm run build && npm run export && touch ./out/.nojekyll

- name: Deploy 🚀
uses: JamesIves/[email protected]
node-version: "20"
cache: ${{ steps.detect-package-manager.outputs.manager }}
- name: Setup Pages
uses: actions/configure-pages@v4
with:
# Automatically inject basePath in your Next.js configuration file and disable
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
#
# You may remove this line if you want to manage the configuration yourself.
static_site_generator: next
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
- name: Build with Next.js
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: public # The branch the action will deploy to
FOLDER: out # The folder the action will deploy to
path: ./dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# next.js
/.next/
/out/
/dist/

# production
/build
Expand Down
37 changes: 37 additions & 0 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,40 @@ export default function Page() {
</div>
);
}

// export default function Page() {
// return (
// <main>
// <div className="flex flex-col items-center justify-center h-screen bg-transparent">
// {/* First rectangle */}
// <div className="relative w-[500px] h-41 text-white items-center justify-center cursor-pointer transition-transform transform hover:scale-110 mb-4">
// <p className={`${montserrat.className} text-xl text-center md:leading-normal`}>
// About
// </p>

// <p className={`${montserrat.className} text-l md:leading-normal`}>
// Sergey Litvinenko is currently pursuing his M.Sc. degree in Quantitative Finance at the Vienna University of Economics and Business.
// Previously, he obtained his undergraduate double degree in Mathematics and Economics at the American University in Bulgaria,
// receiving Outstanding Achievement in Economics award. During his studies, he completed an off-cycle internship at the asset management firm Expat Capital
// and participated in the 2020 CFA Institute Research Challenge. Upon graduation, he joined the Deal Advisory department of KPMG Ukraine to work on valuation projects and M&A transactions,
// gaining valuable analytical and research skills. While obtaining his gradute degree, Sergey worked part-time at the Institutional Clients East Department of RBI AG in Vienna,
// supporting bank and non-bank FIs across wide range of services. In 2021, Sergey passed CFA Exam Level II and is planning to enroll for Level III in 2025.
// </p>
// </div>

// {/* Back button */}
// <div className="flex relative top-5 justify-center gap-4 grid-cols-3 grid-rows-1">
// <div className="justify-center items-end flex flex-1 flex-row">
// <div className="text-center">
// <Link
// href="/"
// className={`${montserrat.className} flex items-center gap-5 self-start rounded-lg bg-yellow-900 px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-yellow-600 md:text-base`}>
// <span>Back</span>
// </Link>
// </div>
// </div>
// </div>
// </div>
// </main>
// );
// }
59 changes: 37 additions & 22 deletions app/contact/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { montserrat } from '@/app/ui/fonts';
import { Metadata } from 'next';
import React from 'react';
import Link from 'next/link';
import { SiGithub, SiGoodreads, SiLinkedin } from "react-icons/si";
import { SiGithub, SiGoodreads, SiLinkedin, SiTwitter } from "react-icons/si";

// import { motion } from 'framer-motion';
//import Image from 'next/image';
Expand All @@ -23,31 +23,45 @@ export default function Page() {
Feel free to drop me a line at [email protected]
</h1> */}
<div className="flex relative top-10 justify-center gap-4 grid-cols-3 grid-rows-2">
<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://www.linkedin.com/in/sergeylitvinenko/">
<SiLinkedin size={50} />
</Link>
</div>

<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://www.linkedin.com/in/sergeylitvinenko/">
<SiLinkedin size={50} />
</Link>
</div>
<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://github.com/sergeylitvinenko1">
<SiGithub size={50}/>
</Link>
</div>
</div>

<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://github.com/sergeylitvinenko1">
<SiGithub size={50}/>
</Link>
</div>
<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://www.goodreads.com/user/show/116411155">
<SiGoodreads size={50}/>
</Link>
</div>
</div>

<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://www.goodreads.com/user/show/116411155">
<SiGoodreads size={50}/>
</Link>
</div>
</div>

<div className="justify-center items-end flex flex-1 flex-row">
<div className={styles.icon}>
<Link
href="https://twitter.com/sergeyltvn">
<SiTwitter size={50}/>
</Link>
</div>
</div>

</div>

<div className="flex relative top-20 justify-center gap-4 grid-cols-3 grid-rows-1">
<div className="justify-center items-end flex flex-1 flex-row">
<div className="text-center">
Expand All @@ -59,6 +73,7 @@ export default function Page() {
</div>
</div>
</div>

</main>
</div>
);
Expand Down
69 changes: 54 additions & 15 deletions app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import styles from '@/app/ui/home.module.css';
import { montserrat } from '@/app/ui/fonts';
import Image from 'next/image';
import { Metadata } from 'next';

import Link from 'next/link';

export const metadata: Metadata = {
Expand All @@ -11,23 +10,63 @@ export const metadata: Metadata = {

export default function Page() {
return (
<div className={styles.container}>
<main className={styles.main}>
<h1 className={`${montserrat.className} sm:text-xl text-lg max-w-3xl leading-relaxed`}>
Some projects
</h1>
<div className="flex relative top-5 justify-center gap-4 grid-cols-3 grid-rows-1">
<div className="justify-center items-end flex flex-1 flex-row">
<div className="text-center">
<Link
href="/"
className={`${montserrat.className} flex items-center gap-5 self-start rounded-lg bg-yellow-900 px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-yellow-600 md:text-base`}>
<span>Back</span>
</Link>
<main>
<div className="flex flex-col items-center justify-center h-screen bg-transparent">
{/* First rectangle */}
<a href={"https://github.com/sergeylitvinenko1/adventofcode"} target="_blank">
<div className="relative w-[500px] h-40 text-white items-center justify-center cursor-pointer transition-transform transform hover:scale-110 mb-4">
<p className={`${montserrat.className} text-xl text-center md:leading-normal`}>
Advent of Code
</p>

<p className={`${montserrat.className} text-l md:leading-normal`}>
Advent of Code is an annual competition designed to practice solving programming puzzles.
I started in 2023 and aim to finishall challenges yet it is going pretty slowly at the moment.
The idea is to change programming language for each year
</p>
</div>
</a>

{/* Second rectangle */}
<a href={"https://retc.luiss.it/"} target="_blank">
<div className="relative w-[500px] h-40 text-white items-center justify-center cursor-pointer transition-transform transform hover:scale-110 mb-4">
<p className={`${montserrat.className} text-xl text-center md:leading-normal`}>
Rotman Trading Competition
</p>

<p className={`${montserrat.className} text-l md:leading-normal`}>
Rotman European Trading Competition (RETC) is an annual one-day event that gathers students from all over Europe
to compete in trading across various markets (electricity, fixed income, and algorithmic equities)
</p>
</div>
</a>

{/* Third rectangle */}
<div className="relative w-[500px] h-40 text-white items-center justify-center cursor-pointer transition-transform transform hover:scale-110 mb-4">
<p className={`${montserrat.className} text-xl text-center md:leading-normal`}>
Academic Paper Replication
</p>

<p className={`${montserrat.className} text-l md:leading-normal`}>
In line with my genuine interest in algorithmic trading (both non- and directional),
I replicate papers on various topics from time to time. I intend to publish my code as I go. Please visit my GitHub
to check for recent updates
</p>
</div>

{/* Back button */}
<div className="flex relative top-5 justify-center gap-4 grid-cols-3 grid-rows-1">
<div className="justify-center items-end flex flex-1 flex-row">
<div className="text-center">
<Link
href="/"
className={`${montserrat.className} flex items-center gap-5 self-start rounded-lg bg-yellow-900 px-6 py-3 text-sm font-medium text-white transition-colors hover:bg-yellow-600 md:text-base`}>
<span>Back</span>
</Link>
</div>
</div>
</div>
</div>
</main>
</div>
);
}
14 changes: 10 additions & 4 deletions app/ui/home.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@
align-items: center;
justify-content: center;
}

.main {
text-align: center;
}

.container_projects {
margin-top: 20%;
align-items: center;
justify-content: center;
}

.main {
text-align: center;
}

.icon {
width: 50px;
Expand Down
19 changes: 19 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Stuff below is for local

// /** @type {import('next').NextConfig} */
// const nextConfig = {};

// export default nextConfig;

// Stuff below is for Github Pages

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
distDir: 'dist',
images: {
unoptimized: true,
}
};

module.exports = nextConfig
Loading

0 comments on commit 56770a9

Please sign in to comment.