diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b459288..5bf5554 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,6 +19,7 @@ stages: - docker --version - docker login -u "$CI_REGISTRY_USER" -p "$CI_JOB_TOKEN" "$CI_REGISTRY/$CI_PROJECT_PATH" +# Create initial test cases below build:builder: extends: .base stage: build @@ -26,6 +27,14 @@ build:builder: - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPENDANCY" --target dependancies -t "$IMAGE_DEPENDANCY" . - docker push "$IMAGE_DEPENDANCY" +build:sourceCode: + extends: .base + stage: build + script: + - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPENDANCY" --cache-from "$IMAGE_BUILD" --target builder -t "$IMAGE_BUILD" . + - docker push "$IMAGE_DEPENDANCY" + +## ADD TEST CASES BELOW ## test:linter: extends: .base stage: test @@ -33,10 +42,11 @@ test:linter: script: - docker run "$IMAGE_BUILD" npm run lint +# Create final minified image of production code deploy: extends: .base stage: deploy needs: ["test:linter"] script: - - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPENDANCY" --cache-from "$IMAGE_DEPLOY" --cache-from "$IMAGE_BUILD" -t "$IMAGE_DEPLOY" . + - docker build --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from "$IMAGE_DEPENDANCY" --cache-from "$IMAGE_BUILD" -t "$IMAGE_DEPLOY" . - docker push "$IMAGE_FINAL" \ No newline at end of file diff --git a/components/navbar.tsx b/components/navbar.tsx index e6717be..cea379e 100644 --- a/components/navbar.tsx +++ b/components/navbar.tsx @@ -1,25 +1,60 @@ import React, {Fragment, ReactNode, useState} from "react"; import {useTheme} from "next-themes"; -import {Disclosure, Menu, Transition} from "@headlessui/react"; -import {XIcon, MenuIcon, BellIcon} from "@heroicons/react/outline" +import {Disclosure, Switch, Transition} from "@headlessui/react"; +import {XIcon, MenuIcon} from "@heroicons/react/outline" import Head from "next/head"; import Link from "next/link"; import Image from "next/image"; + type Props = { children?: ReactNode title?: string description?: string } -const places = [ - {name: "Home", href: "#", current: "true"}, - {name: "About", href: "/about", current: "false"}, -]; +const ThemeSwitch = () => { + const {theme, setTheme} = useTheme(); + const [enabled, setEnabled] = useState(true) -// Combine classNames together to form a single string based on whether it is selected or not. See comment below -function classNames(...classes: string[]) { - return classes.filter(Boolean).join(" ") + if(enabled) { + setTheme("dark") + } else { + setTheme("light") + } + + return ( +