parent
9a60c6b779
commit
2dca08ccef
19
.drone.yml
19
.drone.yml
|
@ -50,7 +50,7 @@ steps:
|
|||
registry: registry.cloud.csclub.uwaterloo.ca
|
||||
repo: registry.cloud.csclub.uwaterloo.ca/snedadah/csc-class-profile-staging
|
||||
|
||||
- name: deploy
|
||||
- name: deploy (staging)
|
||||
image: node:16
|
||||
depends_on:
|
||||
- publish
|
||||
|
@ -60,7 +60,22 @@ steps:
|
|||
commands:
|
||||
- echo "The docker build tag is ${DRONE_BRANCH//\//-}"
|
||||
- 'curl -H "Authorization: $STAGING_AUTH_TOKEN" https://csclub.uwaterloo.ca/~snedadah/webhooks/cscclassprofilestaging?ref=${DRONE_BRANCH//\//-}'
|
||||
|
||||
|
||||
- name: deploy (production)
|
||||
image: node:16
|
||||
depends_on:
|
||||
- export
|
||||
environment:
|
||||
SSH_KEY:
|
||||
from_secret: DEPLOYMENT_SSH_KEY
|
||||
commands:
|
||||
- 'echo "$SSH_KEY" > /tmp/ssh_key'
|
||||
- chmod 600 /tmp/ssh_key
|
||||
- ssh -4 -i /tmp/ssh_key www@caffeine.csclub.uwaterloo.ca -o StrictHostKeyChecking=no '~/bin/classprofile/deploy-classprofile-2022.sh'
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { pageRoutes } from "data/routes";
|
||||
import Link from "next/link";
|
||||
import React, { useState } from "react";
|
||||
import { basePath } from "utils/getBasePath";
|
||||
|
||||
import { Sections } from "./Sections";
|
||||
|
||||
|
@ -32,7 +33,7 @@ export function Header() {
|
|||
className={styles.menuIcon}
|
||||
>
|
||||
<img
|
||||
src="/images/menuIcon.svg"
|
||||
src={basePath + "/images/menuIcon.svg"}
|
||||
width="50"
|
||||
height="50"
|
||||
draggable="false"
|
||||
|
@ -52,7 +53,7 @@ export function Header() {
|
|||
}}
|
||||
>
|
||||
<img
|
||||
src="/images/rightArrow.svg"
|
||||
src={basePath + "/images/rightArrow.svg"}
|
||||
className={styles.arrowIcon}
|
||||
width="50"
|
||||
height="50"
|
||||
|
|
|
@ -50,11 +50,11 @@
|
|||
color: var(--primary-text);
|
||||
}
|
||||
|
||||
.nav li a:hover .linkName {
|
||||
.linkName:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.nav li .linkName {
|
||||
.linkName {
|
||||
margin: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { PageRoutes } from "data/routes";
|
||||
import Link from "next/link";
|
||||
import React from "react";
|
||||
|
||||
import styles from "./Sections.module.css";
|
||||
|
@ -36,12 +37,14 @@ export function Sections({
|
|||
{Object.values(data).map((datum, index) => {
|
||||
return (
|
||||
<li key={`${datum.name}-${index}`}>
|
||||
<a href={datum.url}>
|
||||
<span className={styles.linkNumber}>
|
||||
{String(index).padStart(2, "0")}{" "}
|
||||
</span>
|
||||
<span className={styles.linkName}>{datum.name}</span>
|
||||
</a>
|
||||
<span className={styles.linkNumber}>
|
||||
{String(index).padStart(2, "0")}{" "}
|
||||
</span>
|
||||
<span className={styles.linkName}>
|
||||
<Link className={styles.linkName} href={datum.url}>
|
||||
{datum.name}
|
||||
</Link>
|
||||
</span>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -ex
|
||||
ulimit -u 512
|
||||
|
||||
DIR=$(mktemp --directory)
|
||||
trap "rm -rf $DIR" EXIT
|
||||
|
||||
pushd $DIR
|
||||
|
||||
git clone file:///srv/git/www/cs-2022-class-profile.git --depth=1
|
||||
cd cs-2022-class-profile
|
||||
|
||||
export NEXT_PUBLIC_BASE_PATH="/classprofile/2022"
|
||||
npm install
|
||||
npm run build
|
||||
npm run export
|
||||
|
||||
chgrp -R www out
|
||||
chmod -R g+w out
|
||||
|
||||
shopt -s dotglob
|
||||
|
||||
rm -rf /srv/classprofile/2022/*
|
||||
mv out/* /srv/classprofile/2022/
|
||||
|
||||
popd
|
|
@ -1,11 +1,18 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
let basePath = process.env.NEXT_PUBLIC_BASE_PATH ? process.env.NEXT_PUBLIC_BASE_PATH : "";
|
||||
const nextConfig = {
|
||||
basePath: basePath,
|
||||
assetPrefix: basePath + "/",
|
||||
|
||||
publicRuntimeConfig : { basePath: basePath },
|
||||
|
||||
// test comment
|
||||
reactStrictMode: true,
|
||||
trailingSlash: true,
|
||||
// This image loader supports `next export`, for optimizing next <Image /> tags
|
||||
images: {
|
||||
loader: 'akamai',
|
||||
path: '',
|
||||
path: basePath,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,6 @@
|
|||
import config from "next/config";
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const { publicRuntimeConfig } = config();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
const basePath = publicRuntimeConfig.basePath as string;
|
||||
export { basePath };
|
Loading…
Reference in New Issue