Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2fe605f
[refactor/PPFR-1]: changed logo and title
ignatKupryashin Jun 22, 2025
e3388c3
[refactor/PPFR-1]: change buttons to antd
ignatKupryashin Jun 22, 2025
a0c65b8
[refactor/PPFR-1]: chaged routers
ignatKupryashin Jun 22, 2025
1cd14c5
[refactor/PPFR-1]: changed structure and imports
ignatKupryashin Jun 22, 2025
36b521e
Merge pull request #13 from PrettyPet-Organization/refactor/PPFR-1-re…
ignatKupryashin Jun 22, 2025
80292e0
[feature/PPF-5]: created layout
ignatKupryashin Jun 22, 2025
922d2f9
added layout. started to create navigation
ignatKupryashin Jun 29, 2025
e0b99f7
created Authorized routes
ignatKupryashin Jun 29, 2025
0b38cbc
styled desktop
ignatKupryashin Jul 21, 2025
3abbbbc
created mobile layput. not styled
ignatKupryashin Jul 21, 2025
6d7b7e5
[PPF-5] finished with authorized mobile layout
ignatKupryashin Jul 24, 2025
59bf4c3
Merge pull request #16 from PrettyPet-Organization/feature/ppf-5-auth…
ignatKupryashin Jul 24, 2025
714373a
[PPF-11] created http client
ignatKupryashin Aug 2, 2025
cb09dea
[PPF-11] changed default url
ignatKupryashin Aug 2, 2025
bd87ba8
Merge pull request #17 from PrettyPet-Organization/feature/ppf-11-http
ignatKupryashin Aug 2, 2025
5c87a0b
feat: create nginx conf for ci/cd deployment
nsvk13 Aug 4, 2025
3b67478
ci: initial linter job for ci/cd pipeline
nsvk13 Aug 4, 2025
6bef1b4
ci: initial build job for ci/cd pipeline
nsvk13 Aug 4, 2025
9fa4b03
ci: initial deploy job for ci/cd pipeline
nsvk13 Aug 4, 2025
61b9e73
feat: add Dockerfile with nginx and multi-stage build
nsvk13 Aug 4, 2025
bb7418f
feat: add docker-compose configuration for production
nsvk13 Aug 4, 2025
1bd841e
feat: add .dockerignore to optimize build context
nsvk13 Aug 4, 2025
2f3b47a
Revert "feat: add .dockerignore to optimize build context"
nsvk13 Aug 4, 2025
60d7612
Reapply "feat: add .dockerignore to optimize build context"
nsvk13 Aug 4, 2025
18fb064
Revert "feat: create nginx conf for ci/cd deployment"
nsvk13 Aug 4, 2025
a8029f4
feat: add Dockerfile with nginx multi-stage build
nsvk13 Aug 4, 2025
4e60052
feat: add .dockerignore to optimize build context
nsvk13 Aug 4, 2025
54d8b28
feat: add `docker-compose.yml` for container orchestration
nsvk13 Aug 4, 2025
8620033
feat: add nginx.conf for SPA routing support
nsvk13 Aug 4, 2025
2d3f597
ci: GitHub actions workflows (build, lint, deploy)
nsvk13 Aug 4, 2025
009fdea
fix: vite.config.ts base path for production builds
nsvk13 Aug 4, 2025
98a1d1d
fix: remove unused import causing TypeScript build error
nsvk13 Aug 4, 2025
3081705
Merge pull request #19 from PrettyPet-Organization/feature/pp-8-cicd-…
nsvk13 Aug 4, 2025
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
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
npm-debug.log
dist
.git
.gitignore
README.md
.env
.nyc_output
coverage
.vscode
.idea
*.log
.DS_Store
Thumbs.db
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-files-${{ github.sha }}
path: dist/
retention-days: 7
75 changes: 75 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy to Server

on:
push:
branches: [ main ]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint

- name: TypeScript check
run: npx tsc --noEmit

- name: Build project
run: npm run build

- name: Deploy to server
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT || 22 }}
script: |
echo "🚀 Starting deployment..."

cd /opt

if [ ! -d "frontend-react" ]; then
echo "📥 Cloning repository..."
git clone https://github.com/PrettyPet-Organization/frontend-react.git
else
echo "🔄 Updating repository..."
cd frontend-react
git fetch origin
git reset --hard origin/main
cd ..
fi

cd frontend-react

echo "⏹️ Stopping old containers..."
docker-compose down || true

echo "🔨 Building and starting containers..."
docker-compose up -d --build

echo "⏳ Waiting for startup..."
sleep 10

if docker-compose ps | grep -q "Up"; then
echo "✅ Deployment successful!"
else
echo "❌ Something went wrong"
docker-compose logs
exit 1
fi

docker-compose ps
32 changes: 32 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint
continue-on-error: false

- name: Run TypeScript check
run: npx tsc --noEmit
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# enviroment
.env
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20-alpine3.19 AS builder

WORKDIR /app
COPY package*.json ./
RUN npm ci
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;"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.8'

services:
frontend:
build: .
container_name: prettypet-frontend
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./logs:/var/log/nginx
environment:
- NODE_ENV=production
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Pretty Pet</title>
</head>
<body>
<div id="root"></div>
Expand Down
15 changes: 15 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;

location / {
try_files $uri $uri/ /index.html;
}

location /health {
return 200 "OK";
add_header Content-Type text/plain;
}
}
Loading