Skip to content

Commit

Permalink
Merge pull request #121 from Lilypad-Tech/staging
Browse files Browse the repository at this point in the history
feat: add new website to main
  • Loading branch information
PBillingsby authored Dec 19, 2024
2 parents acd308f + 6e55e0f commit d9ff985
Show file tree
Hide file tree
Showing 131 changed files with 23,321 additions and 1,423 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Website Staging Deploy

on:
push:
branches:
- staging # or the branch you want to deploy from
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
environment: website

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install bun
uses: oven-sh/setup-bun@v1

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "20" # Use the Node.js version compatible with your project

- name: Install pnpm
run: npm install -g pnpm

- name: Install Doppler CLI
run: |
(curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh || wget -t 3 -qO- https://cli.doppler.com/install.sh) | sudo sh
- name: Set up Doppler
run: doppler configure set token ${{ secrets.WEB_DOPPLER_TOKEN }}

- name: Fetch secrets from Doppler and boot
run: doppler run -- npm run boot
env:
DOPPLER_TOKEN: ${{ secrets.WEB_DOPPLER_TOKEN }}

- name: Clean up build output
working-directory: ./apps/website/.next
run: |
rm -rf cache
- name: Deploy to Cloudflare Pages
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.WEB_CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.WEB_CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_PROJECT_NAME: ${{ secrets.WEB_CLOUDFLARE_PROJECT_NAME }}
run: |
npx wrangler pages deploy ./apps/website/out --project-name=$CLOUDFLARE_PROJECT_NAME --branch=main
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
build
.DS_STORE
.DS_STORE
apps/website/public/sitemap*.xml
5 changes: 3 additions & 2 deletions apps/info-dashboard/src/app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import {
generalCheck,
} from "@frontline-hq/untitledui-icons";
import CardHeader from "@/components/CardHeader";
import InputField from "@/components/InputField/Inputfield";
import { InputField } from "@lilypad/shared-components";
import { SectionContainer } from "@lilypad/shared-components";
import TableLeadText from "@/components/Table/TableLeadText";
import TableHeaderCell from "@/components/Table/TableHeaderCell";
import HeadingSection from "@/components/HeadingSection";
import SocialIcon from "@/components/SocialIcon";
import { SocialIcon } from "@lilypad/shared-components";
import * as m from "@/paraglide/messages.js";
import Head from "next/head";
import {
Expand Down Expand Up @@ -216,6 +216,7 @@ export default function Leaderboard() {
e.target.value
)
}
inputSize="sm"
placeholder={m.leaderboard_node_provider_table_inputField_placeholder()}
iconUrl={generalSearchMd}
/>
Expand Down
3 changes: 2 additions & 1 deletion apps/info-dashboard/src/app/node-status/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as m from "@/paraglide/messages";
import { Anchor, SectionContainer } from "@lilypad/shared-components";
import Table from "@/components/Table/Table";
import CardHeader from "@/components/CardHeader";
import InputField from "@/components/InputField/Inputfield";
import { InputField } from "@lilypad/shared-components";
import {
alertAndFeedbackAlertCircle,
generalCheck,
Expand Down Expand Up @@ -246,6 +246,7 @@ export default function NodeStatus() {
e.target.value
)
}
inputSize="sm"
placeholder={m.node_status_node_overview_table_inputField_placeholder()}
iconUrl={generalSearchMd}
/>
Expand Down
10 changes: 7 additions & 3 deletions apps/info-dashboard/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export default function Home() {
</MetricsCard>
);
})}
</SectionContainer> */}
{/* <SectionContainer className="mx-auto pt-uui-4xl w-full justify-between flex uui-desktop:gap-uui-3xl gap-uui-2xl sm:flex-row flex-col snap-x overflow-x-auto no-scrollbar">
</SectionContainer>
<SectionContainer className="mx-auto pt-uui-4xl w-full justify-between flex uui-desktop:gap-uui-3xl gap-uui-2xl sm:flex-row flex-col snap-x overflow-x-auto no-scrollbar">
{(["Nodes", "JobsCompleted"] as const).map((key, id) => {
return (
<CardWithBorder
Expand Down Expand Up @@ -215,7 +215,11 @@ export default function Home() {
height="100%"
>
<AreaChart
data={metricsTransformedData[key]}
data={
metricsTransformedData[
key
]
}
margin={{
top: 0,
right: 0,
Expand Down
3 changes: 1 addition & 2 deletions apps/info-dashboard/src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SectionContainer } from "@lilypad/shared-components";
import Image from "next/image";
import SocialIcon from "./SocialIcon";

import { SocialIcon } from "@lilypad/shared-components";
interface FooterProps extends React.HTMLProps<HTMLDivElement> {
socialLinks: { href: string; iconUrl: string }[];
footerIcon: { src: string; alt: string; href: string };
Expand Down
23 changes: 0 additions & 23 deletions apps/info-dashboard/src/components/InputField/InputAtom.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions apps/info-dashboard/src/components/InputField/InputIconAtom.tsx

This file was deleted.

64 changes: 0 additions & 64 deletions apps/info-dashboard/src/components/InputField/InputWrapper.tsx

This file was deleted.

36 changes: 0 additions & 36 deletions apps/info-dashboard/src/components/InputField/Inputfield.tsx

This file was deleted.

35 changes: 0 additions & 35 deletions apps/info-dashboard/src/components/SocialIcon.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren, ReactNode } from "react";
import { PropsWithChildren } from "react";
import { twMerge } from "tailwind-merge";

export default function _NavItemBase({
Expand Down
16 changes: 11 additions & 5 deletions apps/info-dashboard/src/lib/fetchers/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,27 @@ export async function fetchMetrics() {
return res;
}

export function addValueChange(enrichedTs: TimeSeriesCountEnriched[]) {
export function addValueChange(
enrichedTs: TimeSeriesCountEnriched[],
totalAmount?: number
) {
return sort(enrichedTs, (a, b) =>
ascending(a.epochMillis, b.epochMillis)
).map((val, index, arr) => {
const change =
index > 0 ? arr[index].Count - arr[index - 1].Count : val.Count;
const change = arr[index].Count / (totalAmount ?? arr[index].Count);
return { ...val, change };
});
}

export function toFrontendData(data?: MetricsEndpointReturnType) {
const withChangeCalculated = {
nodes: addValueChange(enrichMetricsTimeSeriesData(data?.Nodes ?? [])),
nodes: addValueChange(
enrichMetricsTimeSeriesData(data?.Nodes ?? []),
data?.TotalNodes
),
jobsCompleted: addValueChange(
enrichMetricsTimeSeriesData(data?.JobsCompleted ?? [])
enrichMetricsTimeSeriesData(data?.JobsCompleted ?? []),
data?.TotalJobs
),
};

Expand Down
5 changes: 5 additions & 0 deletions apps/website-cms/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.git
.gitignore
*.md
dist
2 changes: 2 additions & 0 deletions apps/website-cms/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DATABASE_URI=mongodb://127.0.0.1/payload-template-blank
PAYLOAD_SECRET=YOUR_SECRET_HERE
8 changes: 7 additions & 1 deletion apps/website-cms/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
.pnpm-store
build
dist
/media
node_modules
.DS_Store
.env
.pnpm-store
Loading

0 comments on commit d9ff985

Please sign in to comment.