Skip to content

Commit

Permalink
Initialize the website
Browse files Browse the repository at this point in the history
  • Loading branch information
taoshengshi committed Dec 20, 2024
1 parent 7e8e5a6 commit d7125cb
Show file tree
Hide file tree
Showing 200 changed files with 13,306 additions and 2 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: test
on:
push:
branches: [main]
jobs:
build:
if: ${{ startsWith(github.ref, 'refs/heads/deployment/') || github.ref == 'refs/heads/main' }}
runs-on: [self-hosted]
steps:
- name: chceck code
uses: actions/checkout@v2

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build

- name: Get version
id: version
run: |
if [[ -n "$GITHUB_REF" && "$GITHUB_REF" == "refs/tags/"* ]]; then
echo "tag version"
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
else
echo "commit version"
echo "::set-output name=version::${{ github.sha }}"
fi
- name: Build and push
run: |
docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
docker build -t gitdatateam/datapanda:${{ steps.version.outputs.version }} .
docker push gitdatateam/datapanda:${{ steps.version.outputs.version }}
docker tag gitdatateam/datapanda:${{ steps.version.outputs.version }} gitdatateam/datapanda:latest
docker push gitdatateam/datapanda:latest
- name: Deploy
uses: WyriHaximus/github-action-helm3@v3
with:
exec: /usr/sbin/helm upgrade datapanda --install ./chart --namespace gitdata --set-string tag=latest
kubeconfig: ${{ secrets.KUBECONTENT }}
overrule_existing_kubeconfig: "true"
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
package-lock.json

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:22.6.0-alpine3.20
WORKDIR /usr/src/app

COPY . .
RUN npm install --global pnpm
RUN pnpm install

RUN pnpm run build

FROM nginx:latest

COPY --from=0 /usr/src/app/dist /usr/share/nginx/html
COPY script/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 DataPanda

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# website
website of datapanda.
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
export default tseslint.config({
languageOptions: {
// other options...
parserOptions: {
project: ['./tsconfig.node.json', './tsconfig.app.json'],
tsconfigRootDir: import.meta.dirname,
},
},
})
```

- Replace `tseslint.configs.recommended` to `tseslint.configs.recommendedTypeChecked` or `tseslint.configs.strictTypeChecked`
- Optionally add `...tseslint.configs.stylisticTypeChecked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and update the config:

```js
// eslint.config.js
import react from 'eslint-plugin-react'

export default tseslint.config({
// Set the react version
settings: { react: { version: '18.3' } },
plugins: {
// Add the react plugin
react,
},
rules: {
// other rules...
// Enable its recommended rules
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
},
})
```
11 changes: 11 additions & 0 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v2
name: datapanda
description: Install datapanda to provide datapanda official web page.
version: 1.0.0
home: https://datapanda.xyz/
keywords:
- datapanda
sources:
- https://github.com/datapanda-xyz/website
maintainers:
- name: gitdata team
25 changes: 25 additions & 0 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: datapanda-deployment
namespace: gitdata
labels:
apptype: datapanda
spec:
replicas: 3
selector:
matchLabels:
app: datapanda
template:
metadata:
labels:
app: datapanda
apptype: datapanda
date: "{{ now | unixEpoch }}"
spec:
containers:
- name: datapanda
image: gitdatateam/datapanda:{{ .Values.tag }}
imagePullPolicy: Always
ports:
- containerPort: 80
29 changes: 29 additions & 0 deletions chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: datapanda
namespace: gitdata
annotations:
meta.helm.sh/release-name: datapanda
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
nginx.ingress.kubernetes.io/proxy-read-timeout: "1800"
nginx.ingress.kubernetes.io/proxy-send-timeout: "1800"
labels:
apptype: datapanda
app.kubernetes.io/managed-by: Helm
heritage: Helm
release: datapanda
spec:
ingressClassName: nginx
rules:
- host: datapanda.xyz
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: datapanda-service
port:
number: 80
15 changes: 15 additions & 0 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: datapanda-service
namespace: gitdata
labels:
apptype: datapanda
spec:
type: ClusterIP
selector:
app: datapanda
ports:
- protocol: TCP
port: 80
targetPort: 80
6 changes: 6 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Additional Trusted CAs.
# Enable this flag and add your CA certs as a secret named tls-ca-additional in the namespace.
# See README.md for details.
replicas: 3
ingress_name: nginx
tag: latest
28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
Binary file added gitdata-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module "*.css";
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>DataPanda | Build and ship AI models on a single, collaborative platform</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading

0 comments on commit d7125cb

Please sign in to comment.