Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bcb2c9c34 | ||
| ef2f7a17b8 | |||
|
|
beac734a9b | ||
| 409e1b313d | |||
| 4a15e9dae4 | |||
| 3c1a2d9a1b | |||
| 43114cf955 | |||
| b755b8ac7e | |||
| 8e0bfde1df | |||
| 358458117c | |||
| 509cab1a91 | |||
| e815c23b92 | |||
| 91fcb926ee | |||
|
|
6025684cc3 | ||
| 6e1a1de528 | |||
| d235e79b3d | |||
|
|
76b9c63cd4 | ||
| ad4d64a180 | |||
| 866aebb456 | |||
|
|
97549443f3 | ||
|
|
cda6f02fe9 | ||
|
|
954d5aaad1 | ||
|
|
0406feb2d0 |
@@ -7,25 +7,26 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
uses: http://git.wdipl.com/Rajendra.Reddy/wdipl-actions/.gitea/workflows/ci.yml@main
|
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/ci.yml@baedab602ca859a71cd77af59b5e4d21d6f7067a
|
||||||
|
|
||||||
with:
|
with:
|
||||||
tech_stack: node
|
tech_stack: node
|
||||||
|
|
||||||
run_build: true
|
run_build: 'true'
|
||||||
run_sonar: true
|
run_sonar: 'true'
|
||||||
run_deploy: true
|
run_deploy: 'true'
|
||||||
wait_for_quality_gate: false
|
wait_for_quality_gate: 'false'
|
||||||
|
|
||||||
app_path_beta: /var/www/app-beta
|
app_path_beta: /var/www/app-beta
|
||||||
|
app_path_testing: /var/www/app-testing
|
||||||
app_path_staging: /var/www/app-staging
|
app_path_staging: /var/www/app-staging
|
||||||
app_path_prod: /var/www/app-prod
|
app_path_prod: /var/www/app-prod
|
||||||
|
|
||||||
pm2_id: app
|
pm2_id: app
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
SONARQUBE_HOST: ${{ secrets.SONARQUBE_HOST }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONARQUBE_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
|
||||||
|
|
||||||
BETA_SERVER_HOST: ${{ secrets.BETA_SERVER_HOST }}
|
BETA_SERVER_HOST: ${{ secrets.BETA_SERVER_HOST }}
|
||||||
BETA_SERVER_PORT: ${{ secrets.BETA_SERVER_PORT }}
|
BETA_SERVER_PORT: ${{ secrets.BETA_SERVER_PORT }}
|
||||||
94
.gitea/workflows/compressimages.yml
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
name: Enforce Image Standards
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- beta
|
||||||
|
- testing
|
||||||
|
- client
|
||||||
|
- staging
|
||||||
|
- production
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
paths:
|
||||||
|
- '**/*.jpg'
|
||||||
|
- '**/*.jpeg'
|
||||||
|
- '**/*.png'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
target_branch:
|
||||||
|
description: "Branch to optimize images on"
|
||||||
|
required: false
|
||||||
|
default: "main"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
optimize:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# 🚀 Use your internal image (no apt needed)
|
||||||
|
container:
|
||||||
|
image: git.wdipl.com/wdi-public/image-optimizer:latest
|
||||||
|
#credentials:
|
||||||
|
#username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
#password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# 🔀 Decide branch (PR vs manual)
|
||||||
|
- name: Determine Branch
|
||||||
|
id: branch
|
||||||
|
run: |
|
||||||
|
if [ "${{ gitea.event_name }}" = "pull_request" ]; then
|
||||||
|
echo "branch=${{ gitea.head_ref }}" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "branch=${{ inputs.target_branch }}" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 📥 Checkout correct branch
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: ${{ steps.branch.outputs.branch }}
|
||||||
|
|
||||||
|
# 🖼 Resize images
|
||||||
|
- name: Resize Oversized Images
|
||||||
|
run: |
|
||||||
|
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) \
|
||||||
|
-not -path "*/.git/*" \
|
||||||
|
-not -path "*/node_modules/*" \
|
||||||
|
-exec mogrify -resize 1920x1920\> {} \;
|
||||||
|
|
||||||
|
# 📉 Optimize JPEG
|
||||||
|
- name: Optimize JPEG
|
||||||
|
run: |
|
||||||
|
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) \
|
||||||
|
-not -path "*/.git/*" \
|
||||||
|
-not -path "*/node_modules/*" \
|
||||||
|
-exec jpegoptim --strip-all --max=85 {} \;
|
||||||
|
|
||||||
|
# 📉 Optimize PNG
|
||||||
|
- name: Optimize PNG
|
||||||
|
run: |
|
||||||
|
find . -type f -iname "*.png" \
|
||||||
|
-not -path "*/.git/*" \
|
||||||
|
-not -path "*/node_modules/*" \
|
||||||
|
-exec pngquant --force --ext .png --quality=75-90 {} \;
|
||||||
|
|
||||||
|
# 💾 Commit if changes exist
|
||||||
|
- name: Commit changes
|
||||||
|
run: |
|
||||||
|
git config --global user.name "CI Bot"
|
||||||
|
git config --global user.email "ci@local"
|
||||||
|
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
git add .
|
||||||
|
git commit -m "chore: optimize images via CI"
|
||||||
|
else
|
||||||
|
echo "No changes to commit"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 🚀 Push back to branch
|
||||||
|
- name: Push changes
|
||||||
|
run: |
|
||||||
|
git push origin HEAD:${{ steps.branch.outputs.branch }}
|
||||||
39
.gitea/workflows/sonar.yml
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
name: Sonar Check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- beta
|
||||||
|
- testing
|
||||||
|
- client
|
||||||
|
- staging
|
||||||
|
- production
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sonarqube:
|
||||||
|
name: SonarQube Scan
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: git.wdipl.com/wdi-public/sonar-scanner-cli:12.0.0.3214_8.0.1
|
||||||
|
options: --user root
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Run Sonar Scan
|
||||||
|
run: |
|
||||||
|
REPO_NAME=${{ gitea.event.repository.name }}
|
||||||
|
|
||||||
|
sonar-scanner \
|
||||||
|
-Dsonar.projectKey=$REPO_NAME \
|
||||||
|
-Dsonar.projectName=$REPO_NAME \
|
||||||
|
-Dsonar.sources=. \
|
||||||
|
-Dsonar.host.url=${{ secrets.SONARQUBE_HOST }} \
|
||||||
|
-Dsonar.token=${{ secrets.SONARQUBE_TOKEN }} \
|
||||||
|
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
|
||||||
|
-Dsonar.qualitygate.wait=true
|
||||||
4
.gitignore
vendored
@@ -8,11 +8,11 @@ yarn-error.log*
|
|||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
# Environment files
|
# Enviroment files
|
||||||
.env
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
.env.*.production
|
||||||
# Build output
|
# Build output
|
||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
|
|||||||
BIN
pexels-audstories-37019770.jpg
Normal file
|
After Width: | Height: | Size: 364 KiB |
BIN
pexels-kristof-sass-kovan-64832383-8798229.jpg
Normal file
|
After Width: | Height: | Size: 297 KiB |
BIN
pexels-phiraphonsrithakae-20680213.jpg
Normal file
|
After Width: | Height: | Size: 456 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 318 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 6.4 MiB After Width: | Height: | Size: 586 KiB |
|
Before Width: | Height: | Size: 4.2 MiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 4.3 MiB After Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 3.6 MiB After Width: | Height: | Size: 377 KiB |
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 219 KiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 3.5 MiB After Width: | Height: | Size: 320 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 6.4 MiB After Width: | Height: | Size: 586 KiB |
|
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 255 KiB |
|
Before Width: | Height: | Size: 457 KiB After Width: | Height: | Size: 122 KiB |
|
Before Width: | Height: | Size: 363 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 219 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 4.6 MiB After Width: | Height: | Size: 513 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 261 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 4.7 MiB After Width: | Height: | Size: 259 KiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 4.1 MiB After Width: | Height: | Size: 562 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 258 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 323 KiB |
|
Before Width: | Height: | Size: 4.5 MiB After Width: | Height: | Size: 354 KiB |
|
Before Width: | Height: | Size: 778 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 387 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 46 KiB |