diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..d862b38e4 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,64 @@ +name: Demo Push + +on: + push: + tags: + - v* + +env: + IMAGE_NAME: mhp + +jobs: + # Push image to GitHub Packages. + # See also https://docs.docker.com/docker-hub/builds/ + build: + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v3 + - uses: actions/checkout@v3 + - run: yarn install --frozen-lockfile + - run: yarn export + - uses: actions/cache@v2 + id: restore-build + with: + path: ./out/ + key: ${{ github.sha }} + + push: + runs-on: ubuntu-latest + needs: [build] + permissions: + packages: write + contents: read + + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v2 + id: restore-build + with: + path: ./out/ + key: ${{ github.sha }} + - name: Build image + run: docker build . --tag $IMAGE_NAME --label "runnumber=${GITHUB_RUN_ID}" + + - name: Log in to registry + + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + - name: Push image + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME + + # Change all uppercase to lowercase + IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') + # Strip git ref prefix from version + VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + # Strip "v" prefix from tag name + [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') + # Use Docker `latest` tag convention + [ "$VERSION" == "master" ] && VERSION=latest + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + docker tag $IMAGE_NAME $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION + docker tag $IMAGE_NAME $IMAGE_ID:latest + docker push $IMAGE_ID:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ed587db1f..ca782c441 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,2 @@ -FROM node:16.15.0-alpine3.15 as build - -WORKDIR /app - -COPY ./package.json /app/package.json -COPY ./yarn.lock /app/yarn.lock - -COPY . . -RUN yarn install -RUN yarn export - FROM nginx:1.21.6 -COPY --from=build /app/out /usr/share/nginx/html +COPY ./out /usr/share/nginx/html \ No newline at end of file diff --git a/components/AppShelf/AddAppShelfItem.tsx b/components/AppShelf/AddAppShelfItem.tsx index 3627e8c1c..d8e619a9d 100644 --- a/components/AppShelf/AddAppShelfItem.tsx +++ b/components/AppShelf/AddAppShelfItem.tsx @@ -18,6 +18,7 @@ import { useState } from 'react'; import { Apps } from 'tabler-icons-react'; import { useConfig } from '../../tools/state'; import { ServiceTypeList } from '../../tools/types'; +import { AppShelfItemWrapper } from './AppShelfItemWrapper'; export default function AddItemShelfItem(props: any) { const { addService } = useConfig(); @@ -34,30 +35,39 @@ export default function AddItemShelfItem(props: any) { > - - - - - setOpened(true)} size={60} /> - - Add Service + + + + + Add a service + - - + + + + + setOpened(true)} size={60} /> + + + + ); } diff --git a/components/AppShelf/AppShelf.tsx b/components/AppShelf/AppShelf.tsx index bf47a7c4c..509d3f676 100644 --- a/components/AppShelf/AppShelf.tsx +++ b/components/AppShelf/AppShelf.tsx @@ -3,7 +3,6 @@ import { motion } from 'framer-motion'; import { Text, AspectRatio, - createStyles, SimpleGrid, Card, useMantineTheme, @@ -11,20 +10,12 @@ import { Group, Space, } from '@mantine/core'; -import AppShelfMenu from './AppShelfMenu'; -import AddItemShelfItem from './AddAppShelfItem'; import { useConfig } from '../../tools/state'; import { pingQbittorrent } from '../../tools/api'; import { serviceItem } from '../../tools/types'; - -const useStyles = createStyles((theme) => ({ - main: { - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1], - //TODO: #3 Fix this temporary fix and make the width and height dynamic / responsive - width: 200, - height: 180, - }, -})); +import AddItemShelfItem from './AddAppShelfItem'; +import { AppShelfItemWrapper } from './AppShelfItemWrapper'; +import AppShelfMenu from './AppShelfMenu'; const AppShelf = (props: any) => { const { config, addService, removeService, setConfig } = useConfig(); @@ -58,7 +49,6 @@ export function AppShelfItem(props: any) { const { service }: { service: serviceItem } = props; const theme = useMantineTheme(); const { removeService } = useConfig(); - const { classes } = useStyles(); const [hovering, setHovering] = useState(false); return ( - + @@ -128,7 +112,7 @@ export function AppShelfItem(props: any) { - + ); } diff --git a/components/AppShelf/AppShelfItemWrapper.tsx b/components/AppShelf/AppShelfItemWrapper.tsx new file mode 100644 index 000000000..a305661e6 --- /dev/null +++ b/components/AppShelf/AppShelfItemWrapper.tsx @@ -0,0 +1,21 @@ +import { useMantineTheme, Card } from '@mantine/core'; + +export function AppShelfItemWrapper(props: any) { + const { children, hovering } = props; + const theme = useMantineTheme(); + return ( + + {children} + + ); +} diff --git a/components/layout/Aside.tsx b/components/layout/Aside.tsx new file mode 100644 index 000000000..679e35862 --- /dev/null +++ b/components/layout/Aside.tsx @@ -0,0 +1,18 @@ +import { Aside as MantineAside } from '@mantine/core'; +import { CalendarModule } from '../modules/calendar/CalendarModule'; +import ModuleWrapper from '../modules/moduleWrapper'; + +export default function Aside() { + return ( + + ); +} diff --git a/components/layout/Layout.tsx b/components/layout/Layout.tsx index 5e4d45cdd..bfb1a2dc3 100644 --- a/components/layout/Layout.tsx +++ b/components/layout/Layout.tsx @@ -1,7 +1,8 @@ -import { AppShell, Aside, Center, createStyles } from '@mantine/core'; +import { AppShell, Center, createStyles } from '@mantine/core'; import { Header } from './Header'; import { Footer } from './Footer'; -import CalendarComponent from '../modules/calendar/CalendarModule'; +import Aside from './Aside'; +import Navbar from './Navbar'; const useStyles = createStyles((theme) => ({ main: { @@ -15,18 +16,8 @@ export default function Layout({ children, style }: any) { const { classes, cx } = useStyles(); return (