CI/CD
This commit is contained in:
@@ -0,0 +1,88 @@
|
|||||||
|
name: Frontend CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'frontend/**'
|
||||||
|
- '.gitea/workflows/frontend.yml'
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'frontend/**'
|
||||||
|
- '.gitea/workflows/frontend.yml'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-test:
|
||||||
|
name: Build, Lint & Test
|
||||||
|
runs-on: self-hosted
|
||||||
|
container:
|
||||||
|
image: mirror2.chabokan.net/ubuntu:22.04
|
||||||
|
options: --add-host gitea:172.17.0.1
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Setup Ubuntu apt mirrors
|
||||||
|
run: |
|
||||||
|
tee /etc/apt/sources.list > /dev/null <<'EOF'
|
||||||
|
deb http://mirror.iranserver.com/ubuntu/ jammy main restricted universe multiverse
|
||||||
|
deb http://mirror.iranserver.com/ubuntu/ jammy-updates main restricted universe multiverse
|
||||||
|
deb http://mirror.iranserver.com/ubuntu/ jammy-security main restricted universe multiverse
|
||||||
|
deb http://mirror.iranserver.com/ubuntu/ jammy-backports main restricted universe multiverse
|
||||||
|
|
||||||
|
deb [trusted=yes] https://mirror2.chabokan.net/ubuntu focal main universe
|
||||||
|
deb [trusted=yes] https://mirror2.chabokan.net/ubuntu focal-updates main universe
|
||||||
|
deb [trusted=yes] https://mirror2.chabokan.net/ubuntu focal-security main universe
|
||||||
|
EOF
|
||||||
|
apt-get update
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: |
|
||||||
|
apt-get install -y git nodejs npm build-essential
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
run: |
|
||||||
|
git clone http://gitea:3000/sajad-dev/Frontend.git .
|
||||||
|
|
||||||
|
- name: Configure NPM Mirrors
|
||||||
|
run: |
|
||||||
|
npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
|
|
||||||
|
npm config set @runflare:registry https://mirror-npm.runflare.com/
|
||||||
|
npm config set @chabokan:registry https://mirror2.chabokan.net/npm/
|
||||||
|
|
||||||
|
npm config set strict-ssl false
|
||||||
|
npm config set fetch-retries 5
|
||||||
|
npm config set fetch-retry-mintimeout 20000
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm install --registry=https://package-mirror.liara.ir/repository/npm/
|
||||||
|
|
||||||
|
- name: Build project
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm run build --if-present
|
||||||
|
|
||||||
|
- name: Run Lint
|
||||||
|
run: |
|
||||||
|
cd frontend
|
||||||
|
npm run lint --if-present
|
||||||
|
|
||||||
|
# - name: Setup SSH key
|
||||||
|
# run: |
|
||||||
|
# mkdir -p ~/.ssh
|
||||||
|
# echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
|
||||||
|
# chmod 600 ~/.ssh/id_ed25519
|
||||||
|
# ssh-keyscan -p ${{secrets.SERVER_SSH_PORT}} -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
|
# - name: Deploy
|
||||||
|
# if: github.ref == 'refs/heads/main'
|
||||||
|
# run: |
|
||||||
|
# ssh ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_HOST }} -p ${{secrets.SERVER_SSH_PORT}} << 'EOF'
|
||||||
|
# cd /opt/myproject/frontend
|
||||||
|
# git pull origin main
|
||||||
|
# # در صورت استفاده از PM2 یا Systemd:
|
||||||
|
# sudo systemctl restart frontend
|
||||||
|
# EOF
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
name: Frontend CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'frontend/**'
|
||||||
|
- 'frontend/.github/workflows/frontend.yml'
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
|
paths:
|
||||||
|
- 'frontend/**'
|
||||||
|
- 'frontend/.github/workflows/frontend.yml'
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: frontend
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build, Lint & Test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
node-version: ['20']
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Cache npm dependencies
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-npm-frontend-${{ hashFiles('frontend/package-lock.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-npm-frontend-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint --if-present
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm test --if-present
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
name: Deploy Frontend
|
||||||
|
needs: build
|
||||||
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Deploy via SSH
|
||||||
|
uses: appleboy/ssh-action@v1
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.SSH_HOST }}
|
||||||
|
username: ${{ secrets.SSH_USER }}
|
||||||
|
port: ${{ secrets.SSH_PORT }}
|
||||||
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
script: |
|
||||||
|
cd /opt/myproject/frontend
|
||||||
|
git pull origin main
|
||||||
|
sudo systemctl restart frontend
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
# Stage 1: Dependencies
|
# Stage 1: Dependencies
|
||||||
FROM node:20-alpine AS deps
|
FROM node:20-alpine AS deps
|
||||||
|
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
# Install OpenSSL for Prisma
|
# Install OpenSSL for Prisma
|
||||||
RUN apk add --no-cache openssl libc6-compat
|
RUN apk add --no-cache openssl libc6-compat
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -12,6 +13,7 @@ RUN npm install --ignore-scripts
|
|||||||
|
|
||||||
# Stage 2: Builder
|
# Stage 2: Builder
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
|
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
# Install OpenSSL for Prisma
|
# Install OpenSSL for Prisma
|
||||||
RUN apk add --no-cache openssl libc6-compat
|
RUN apk add --no-cache openssl libc6-compat
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -49,6 +51,7 @@ RUN npm run build
|
|||||||
|
|
||||||
# Stage 3: Runner
|
# Stage 3: Runner
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
|
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 44 KiB |
+3
-28
@@ -3,34 +3,9 @@ import type { SVGAttributes } from 'react'
|
|||||||
|
|
||||||
const Logo = (props: SVGAttributes<SVGElement>) => {
|
const Logo = (props: SVGAttributes<SVGElement>) => {
|
||||||
return (
|
return (
|
||||||
<svg width='1.4583em' height='1em' viewBox='0 0 35 24' fill='none' xmlns='http://www.w3.org/2000/svg' {...props}>
|
<img style={{
|
||||||
<path
|
width:"8em"
|
||||||
fillRule='evenodd'
|
}} src='logo svg.svg'/>
|
||||||
clipRule='evenodd'
|
|
||||||
d='M0.00188479 0V7.47707C0.00188479 7.47707 -0.145285 9.83135 2.161 11.8242L14.9358 23.9961L21.5792 23.9107L20.5136 10.7809L17.9947 7.82497L10.0778 0H0.00188479Z'
|
|
||||||
fill='currentColor'
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
opacity='0.06'
|
|
||||||
fillRule='evenodd'
|
|
||||||
clipRule='evenodd'
|
|
||||||
d='M8.39807 17.9307L13.6581 3.53127L18.059 7.91564L8.39807 17.9307Z'
|
|
||||||
fill='#161616'
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
opacity='0.06'
|
|
||||||
fillRule='evenodd'
|
|
||||||
clipRule='evenodd'
|
|
||||||
d='M8.81183 17.3645L15.2093 5.06165L18.0926 7.94695L8.81183 17.3645Z'
|
|
||||||
fill='#161616'
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fillRule='evenodd'
|
|
||||||
clipRule='evenodd'
|
|
||||||
d='M8.47955 17.8436L25.8069 0H34.9091V7.50963C34.9091 7.50963 34.7195 10.0128 33.4463 11.3517L21.5808 24H14.9387L8.47955 17.8436Z'
|
|
||||||
fill='currentColor'
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ const Logo = ({ color }: { color?: CSSProperties['color'] }) => {
|
|||||||
return (
|
return (
|
||||||
<div className='flex items-center'>
|
<div className='flex items-center'>
|
||||||
<VuexyLogo className='text-2xl text-primary' />
|
<VuexyLogo className='text-2xl text-primary' />
|
||||||
<LogoText
|
{/* <LogoText
|
||||||
color={color}
|
color={color}
|
||||||
ref={logoTextRef}
|
ref={logoTextRef}
|
||||||
isHovered={isHovered}
|
isHovered={isHovered}
|
||||||
@@ -81,7 +81,7 @@ const Logo = ({ color }: { color?: CSSProperties['color'] }) => {
|
|||||||
isBreakpointReached={isBreakpointReached}
|
isBreakpointReached={isBreakpointReached}
|
||||||
>
|
>
|
||||||
{themeConfig.templateName}
|
{themeConfig.templateName}
|
||||||
</LogoText>
|
</LogoText> */}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export type PrimaryColorConfig = {
|
|||||||
|
|
||||||
// Primary color config object
|
// Primary color config object
|
||||||
const primaryColorConfig: PrimaryColorConfig[] = [
|
const primaryColorConfig: PrimaryColorConfig[] = [
|
||||||
|
|
||||||
{
|
{
|
||||||
id: 'palette-1',
|
id: 'palette-1',
|
||||||
paletteKey: 'purple',
|
paletteKey: 'purple',
|
||||||
@@ -94,7 +95,23 @@ const primaryColorConfig: PrimaryColorConfig[] = [
|
|||||||
light: '#7AC5F7',
|
light: '#7AC5F7',
|
||||||
dark: '#1A7BC4'
|
dark: '#1A7BC4'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'palette-6',
|
||||||
|
paletteKey: 'green',
|
||||||
|
name: 'Green Palette',
|
||||||
|
main: '#97AE48',
|
||||||
|
light: {
|
||||||
|
main: '#97AE48',
|
||||||
|
light: '#C1CF8B',
|
||||||
|
dark: '#758543'
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
main: '#97AE48',
|
||||||
|
light: '#C1CF8B',
|
||||||
|
dark: '#758543'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default primaryColorConfig
|
export default primaryColorConfig
|
||||||
|
|||||||
Reference in New Issue
Block a user