Initial commit

This commit is contained in:
wsc-admin
2026-04-02 19:35:47 +09:00
commit f577d2673b
15 changed files with 142 additions and 0 deletions

24
.gitea/workflows/ci.yaml Normal file
View File

@@ -0,0 +1,24 @@
name: Build and deploy
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Docker image
run: DOCKER_BUILDKIT=0 docker build --network=wsc2026-infra_wsc-network . --tag git.webtech.worldskillskorea.io/${{ github.repository }}:latest
- name: Login to registry
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.webtech.worldskillskorea.io -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Push image
run: docker push git.webtech.worldskillskorea.io/${{ github.repository }}:latest
- name: Deploy
run: |
curl -s -X POST https://admin.webtech.worldskillskorea.io/api/deploy \
-H "Authorization: Bearer ${{ secrets.PULLDECK_TOKEN }}" \
-H "Content-Type: application/json" \
-d '{"image":"git.webtech.worldskillskorea.io/${{ github.repository }}:latest"}'

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
node_modules
dist
.DS_Store
*.local

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
registry=http://verdaccio.webtech.worldskillskorea.io

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
# build stage
FROM node:20-alpine as build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# production stage
FROM nginx:1.19.0 as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
COPY nginx.conf /etc/nginx/conf.d/default.conf
CMD ["nginx", "-g", "daemon off;"]

1
README.md Normal file
View File

@@ -0,0 +1 @@
# React + TypeScript + Vite

12
index.html Normal file
View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>React TS App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

9
nginx.conf Normal file
View File

@@ -0,0 +1,9 @@
server {
listen 80;
location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
}

22
package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "react-ts-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.3.4",
"typescript": "~5.7.2",
"vite": "^6.2.0"
}
}

0
public/vite.svg Normal file
View File

3
src/App.css Normal file
View File

@@ -0,0 +1,3 @@
.App { text-align: center; padding: 2rem; }
h1 { color: #61dafb; }
button { font-size: 1rem; padding: 0.5rem 1rem; cursor: pointer; }

18
src/App.tsx Normal file
View File

@@ -0,0 +1,18 @@
import { useState } from 'react'
import './App.css'
function App(): JSX.Element {
const [count, setCount] = useState<number>(0)
return (
<div className="App">
<h1>Hello React + TypeScript!</h1>
<button onClick={() => setCount(c => c + 1)}>
count is {count}
</button>
<p>Edit <code>src/App.tsx</code> to get started.</p>
</div>
)
}
export default App

2
src/index.css Normal file
View File

@@ -0,0 +1,2 @@
:root { font-family: Inter, system-ui, sans-serif; }
body { margin: 0; display: flex; place-items: center; min-height: 100vh; }

10
src/main.tsx Normal file
View File

@@ -0,0 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)

16
tsconfig.json Normal file
View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
"jsx": "react-jsx",
"resolveJsonModule": true,
"isolatedModules": true,
"esModuleInterop": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"noEmit": true
},
"include": ["src"]
}

6
vite.config.ts Normal file
View File

@@ -0,0 +1,6 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
})