diff --git a/.drone.yml b/.drone.yml index 61536adf..aab69260 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,18 +4,18 @@ type: docker name: node16 steps: -- name: check-lockfile - image: node:16 - commands: - - node ./check-lockfile.js - - name: install-deps image: node:16 - depends_on: - - check-lockfile commands: - npm install +- name: check-lockfile + image: node:16 + depends_on: + - install-deps + commands: + - npm run check-lockfile + - name: lint image: node:16 depends_on: @@ -28,12 +28,20 @@ steps: depends_on: - install-deps commands: - - npm run build + - npm run build:web + +- name: generate-calendar + image: node:16 + depends_on: + - install-deps + commands: + - npm run generate:calendar - name: export image: node:16 depends_on: - build + - generate-calendar commands: - npm run export @@ -46,8 +54,27 @@ steps: from_secret: STAGING_TOKEN commands: - 'curl -XPOST -H "Authorization: $TOKEN" -H "X-Branch: $DRONE_BRANCH" "https://csclub.uwaterloo.ca/~a3thakra/update-csc/"' + when: + branch: + exclude: + - main + +- 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/deploy-website.sh' + when: + branch: + - main trigger: event: exclude: - - pull_request #avoid double build on PRs \ No newline at end of file + - pull_request #avoid double build on PRs diff --git a/.gitignore b/.gitignore index 922d92a5..d0cff56b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# Calendar is automatically generated +/public/events.ics \ No newline at end of file diff --git a/README.md b/README.md index af122ff6..bbd8a43a 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,9 @@ How to upgrade npm: `npm i -g npm` - `npm install` to install project dependencies - `npm run build` to generate html/css/js - `npm run export` to move the built files (along with assets in the public directory) to the `/out` directory -- Use your favourite web server to host the files in the `/out` directory. (A very simple one would be `python -m http.server` - not sure if it should actually be used for production :P) \ No newline at end of file +- Use your favourite web server to host the files in the `/out` directory. (A very simple one would be `python -m http.server` - not sure if it should actually be used for production :P) + +# Deploy + +- `groups` (make sure you're in the `www` group) +- `curl -o- https://git.csclub.uwaterloo.ca/www/www-new/raw/branch/main/deploy.sh | bash` (run on `caffeine`) diff --git a/components/Blockquote.module.css b/components/Blockquote.module.css new file mode 100644 index 00000000..64a0c5be --- /dev/null +++ b/components/Blockquote.module.css @@ -0,0 +1,5 @@ +.blockquote { + margin: 0; + padding-left: calc(10rem / 16); + border-left: calc(3rem / 16) solid var(--primary-accent-light); +} diff --git a/components/Blockquote.tsx b/components/Blockquote.tsx new file mode 100644 index 00000000..51ece282 --- /dev/null +++ b/components/Blockquote.tsx @@ -0,0 +1,13 @@ +import React, { ReactNode } from "react"; + +import styles from "./Blockquote.module.css"; + +export interface Props { + children: ReactNode; +} + +export function Blockquote(props: Props) { + return ( +
{props.children}
+ ); +} diff --git a/components/Button.module.css b/components/Button.module.css index 93ebcab1..db11799d 100644 --- a/components/Button.module.css +++ b/components/Button.module.css @@ -17,6 +17,16 @@ cursor: pointer; } +.button:focus, +.link:focus { + box-shadow: 0 0 0 calc(4rem / 16) var(--secondary-accent); +} + +.small.button:focus, +.small.link:focus { + box-shadow: 0 0 0 calc(3rem / 16) var(--secondary-accent); +} + .link { text-decoration: none; } diff --git a/components/EventCard.tsx b/components/EventCard.tsx index e9e5eaec..40120970 100644 --- a/components/EventCard.tsx +++ b/components/EventCard.tsx @@ -7,7 +7,7 @@ import { Link } from "./Link"; import styles from "./EventCard.module.css"; -interface BaseProps { +interface EventCardProps { name: string; short: string; date: Date; @@ -15,15 +15,13 @@ interface BaseProps { location: string; poster?: string; registerLink?: string; + permaLink: string; + showDescription?: boolean; children: ReactNode; } -type EventCardProps = - | (BaseProps & { showDescription?: false; link: string }) - | (BaseProps & { showDescription: true; link?: string }); - export function EventCard({ - link, + permaLink, name, date, online, @@ -60,8 +58,8 @@ export function EventCard({

- {!showDescription && link && ( - + {!showDescription && ( + Learn more )} diff --git a/components/EventDescriptionCard.module.css b/components/EventDescriptionCard.module.css index baab9b78..69e8d679 100644 --- a/components/EventDescriptionCard.module.css +++ b/components/EventDescriptionCard.module.css @@ -29,6 +29,9 @@ } .logo { + display: flex; + justify-content: center; + align-items: center; width: calc(32rem / 16); margin-left: auto; } diff --git a/components/EventDescriptionCard.tsx b/components/EventDescriptionCard.tsx index 86c9b3db..67dde493 100644 --- a/components/EventDescriptionCard.tsx +++ b/components/EventDescriptionCard.tsx @@ -3,6 +3,7 @@ import React from "react"; import { Button } from "./Button"; import { EventSetting } from "./EventSetting"; import { Image } from "./Image"; +import { Link } from "./Link"; import { Discord, Twitch, Instagram, Facebook } from "./SocialLinks"; import styles from "./EventDescriptionCard.module.css"; @@ -15,6 +16,7 @@ interface Props { date: Date; poster?: string; registerLink?: string; + permaLink: string; } /** @@ -35,6 +37,7 @@ export function EventDescriptionCard({ date, online, registerLink, + permaLink, }: Props) { const Icon = getIcon(location); @@ -48,6 +51,7 @@ export function EventDescriptionCard({

{short}

+ Learn more