commit 20280a062ff966f5654aa5f74050075fa69915dc Author: wsc-admin Date: Thu Apr 2 19:35:45 2026 +0900 Initial commit diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..80fcc00 --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -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"}' \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e9b06f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules +dist +.DS_Store +*.local \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..55ef363 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=http://verdaccio.webtech.worldskillskorea.io \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4ac4ce9 --- /dev/null +++ b/Dockerfile @@ -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;"] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..74797d9 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# React + Vite \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..6412781 --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + React App + + +
+ + + \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..764f902 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + + location / { + root /usr/share/nginx/html/; + include /etc/nginx/mime.types; + try_files $uri $uri/ /index.html; + } +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..e657b8d --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "react-app", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.3.4", + "vite": "^6.2.0" + } +} \ No newline at end of file diff --git a/public/vite.svg b/public/vite.svg new file mode 100644 index 0000000..e69de29 diff --git a/src/App.css b/src/App.css new file mode 100644 index 0000000..7e27752 --- /dev/null +++ b/src/App.css @@ -0,0 +1,3 @@ +.App { text-align: center; padding: 2rem; } +h1 { color: #61dafb; } +button { font-size: 1rem; padding: 0.5rem 1rem; cursor: pointer; } \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx new file mode 100644 index 0000000..4f4df5a --- /dev/null +++ b/src/App.jsx @@ -0,0 +1,18 @@ +import { useState } from 'react' +import './App.css' + +function App() { + const [count, setCount] = useState(0) + + return ( +
+

Hello React!

+ +

Edit src/App.jsx to get started.

+
+ ) +} + +export default App \ No newline at end of file diff --git a/src/index.css b/src/index.css new file mode 100644 index 0000000..218260f --- /dev/null +++ b/src/index.css @@ -0,0 +1,2 @@ +:root { font-family: Inter, system-ui, sans-serif; } +body { margin: 0; display: flex; place-items: center; min-height: 100vh; } \ No newline at end of file diff --git a/src/main.jsx b/src/main.jsx new file mode 100644 index 0000000..0291fe5 --- /dev/null +++ b/src/main.jsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App.jsx' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root')).render( + + + , +) \ No newline at end of file diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..3e34260 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +export default defineConfig({ + plugins: [react()], +}) \ No newline at end of file