From 0684b70dad809e4f4c26b09bb60748e2582eff98 Mon Sep 17 00:00:00 2001 From: d3m0k1d Date: Sun, 1 Feb 2026 22:33:18 +0300 Subject: [PATCH] feat: full recode a home page and add docker file, start write a cd pipline --- .gitea/workflows/cd.yml | 40 ++++++++++ frontend/Dockerfile | 15 ++++ frontend/index.html | 20 ++--- frontend/nginx.conf | 21 +++++ frontend/src/App.tsx | 3 +- frontend/src/assets/react.svg | 1 - frontend/src/components/Navigation.tsx | 29 ++----- frontend/src/components/Skills.tsx | 103 +++++++++++++++++++++++++ frontend/src/pages/Home.tsx | 28 +++---- 9 files changed, 214 insertions(+), 46 deletions(-) create mode 100644 .gitea/workflows/cd.yml create mode 100644 frontend/Dockerfile create mode 100644 frontend/nginx.conf delete mode 100644 frontend/src/assets/react.svg create mode 100644 frontend/src/components/Skills.tsx diff --git a/.gitea/workflows/cd.yml b/.gitea/workflows/cd.yml new file mode 100644 index 0000000..3518c81 --- /dev/null +++ b/.gitea/workflows/cd.yml @@ -0,0 +1,40 @@ +name: Deploy + + +on: + push: + branches: + - master + + + +jobs: + deploy-frontend: + runs-on: ubuntu-latest + steps: + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: gitea.d3m0k1d.ru + username: d3m0k1d + password: ${{ secrets.TOKEN }} + + - name: Download QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./frontend + file: ./frontend/Dockerfile + push: true + tags: gitea.d3m0k1d.ru/d3m0k1d/frontend:latest + - name: Deploy at server + uses: appleboy/ssh-action@v1.2.5 + with: + + + diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..f5e93d8 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,15 @@ +FROM node:25-alpine3.23 AS builder + +WORKDIR /app + +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build +FROM nginx:alpine +COPY --from=builder /app/dist /usr/share/nginx/html + +COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend/index.html b/frontend/index.html index 072a57e..9edb463 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1,13 +1,13 @@ - - - - - frontend - - -
- - + + + + + d3m0k1d - DevOps Engineer & InfoSec Student + + +
+ + diff --git a/frontend/nginx.conf b/frontend/nginx.conf new file mode 100644 index 0000000..45327c0 --- /dev/null +++ b/frontend/nginx.conf @@ -0,0 +1,21 @@ +server { + listen 80; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + # Кэширование статики + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # Gzip сжатие + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript; +} diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index db8f697..2c984b4 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -2,13 +2,14 @@ import "./App.css"; import Navigation from "./components/Navigation.tsx"; import Footer from "./components/Footer.tsx"; import Home from "./pages/Home.tsx"; - +import About from "./components/Skills.tsx"; function App() { return (
+
diff --git a/frontend/src/assets/react.svg b/frontend/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/frontend/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/components/Navigation.tsx b/frontend/src/components/Navigation.tsx index adfe460..d00cd1c 100644 --- a/frontend/src/components/Navigation.tsx +++ b/frontend/src/components/Navigation.tsx @@ -5,30 +5,24 @@ export default function Navigation() { return ( <> -