Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI #1

Merged
merged 3 commits into from
Nov 18, 2024
Merged

CI #1

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEXT_PUBLIC_PROJECT_ID=2719448e2ce94fdd269a3c8587123bcc
27 changes: 27 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy development

on:
pull_request:
workflow_dispatch:

jobs:
deploy-package:
name: Deploy package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy app
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
alias_domain: "paralink-dev"
project_name: "paralink"
script_run: false
dist_path: .
enable_notify_comment: true
enable_notify_slack: true
slack_channel: public-ringdao-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
28 changes: 28 additions & 0 deletions .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy production

on:
push:
tags:
- 'v*'

jobs:

deploy-package:
name: Deploy package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy app
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
prod_mode: true
project_name: "paralink"
script_run: false
dist_path: .
enable_notify_slack: true
slack_channel: public-ringdao-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
27 changes: 27 additions & 0 deletions .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Deploy staging

on:
push:
branches: [main]
workflow_dispatch:

jobs:
deploy-package:
name: Deploy package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy app
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
alias_domain: "paralink-stg"
project_name: "paralink"
script_run: false
dist_path: .
enable_notify_slack: true
slack_channel: public-ringdao-apps
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ yarn-debug.log*
yarn-error.log*

# env files (can opt-in for commiting if needed)
.env*
# .env*

# vercel
.vercel
Expand Down
10 changes: 10 additions & 0 deletions public/images/404.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/app/(dashboard)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const dynamic = 'force-dynamic'
export const dynamic = 'force-dynamic';

import {
fetchPolkadotAssetRegistry,
Expand All @@ -13,7 +13,6 @@ export default async function Page() {
fetchChainsInfo(),
fetchAssetsInfo()
]);

return (
<Dashboard
polkadotAssetRegistry={polkadotAsset}
Expand Down
9 changes: 9 additions & 0 deletions src/app/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use client';

import ErrorComponent from '@/components/error';

const Error = () => {
return <ErrorComponent />;
};

export default Error;
7 changes: 7 additions & 0 deletions src/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import NotFoundComponent from '@/components/not-found';

const NotFound = () => {
return <NotFoundComponent />;
};

export default NotFound;
37 changes: 37 additions & 0 deletions src/components/error-display.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import Image from 'next/image';
import { Button } from './ui/button';

interface Props {
title: string;
message: string;
buttonText: string;
action: () => void;
}

const ErrorDisplay = ({ buttonText, action, title, message }: Props) => {
return (
<div className="flex flex-col items-center justify-center gap-5">
<div className="relative h-[12.5rem] w-[14.36225rem] shrink-0 object-contain">
<Image alt={title} src="/images/404.svg" width={230} height={200} />
</div>

<div className="flex flex-col items-center justify-center">
<h2 className="m-0 text-center text-[3.125rem] font-bold text-foreground">
{title}
</h2>
<p className="m-0 text-center text-[0.875rem] font-bold text-foreground">
{message}
</p>
</div>
<Button
onClick={action}
className="h-[2.125rem] gap-[0.3125rem]"
color="primary"
>
{buttonText}
</Button>
</div>
);
};

export default ErrorDisplay;
16 changes: 16 additions & 0 deletions src/components/error.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import ErrorDisplay from './error-display';

const Error = () => {
return (
<div className="flex h-[calc(100vh-var(--header-height)-var(--footer-height))] w-full items-center justify-center">
<ErrorDisplay
title="Error"
message="Sorry, something went wrong"
buttonText="Refresh"
action={() => window.location.reload()}
/>
</div>
);
};

export default Error;
20 changes: 20 additions & 0 deletions src/components/not-found.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use client';

import { useRouter } from 'next/navigation';
import ErrorDisplay from './error-display';

const NotFound = () => {
const router = useRouter();
return (
<div className="flex h-[calc(100vh-var(--header-height)-var(--footer-height))] w-full items-center justify-center">
<ErrorDisplay
title="404"
message="Sorry, Page not found"
buttonText="Back to home >"
action={() => router.push('/')}
/>
</div>
);
};

export default NotFound;
Loading