Compare commits
36 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
786f7389ac | ||
|
|
c840fdc81b | ||
|
|
9e589de95a | ||
|
|
dddc077a10 | ||
|
|
08f158b8da | ||
|
|
2d1b992a81 | ||
|
|
5fbc8f449c | ||
|
|
0b395e96ac | ||
|
|
d7588f6d73 | ||
|
|
9087daa168 | ||
|
|
4b2b9c119e | ||
|
|
10241e464d | ||
|
|
aff6834329 | ||
|
|
d71a7542f7 | ||
|
|
c53f7cc4b7 | ||
|
|
eef6fb3856 | ||
|
|
dc52fc7e51 | ||
|
|
4e9c51fc55 | ||
|
|
e0795ca2d9 | ||
|
|
0ad291b7a6 | ||
|
|
bf178bb3f0 | ||
|
|
552f4a717a | ||
| a43ce681c5 | |||
| 4c391d033e | |||
| bb5d5440ed | |||
| 16b79b912d | |||
| ea983502fa | |||
| 11398ebd80 | |||
| 09685f1d46 | |||
| 610bcbec1e | |||
| b9ffd1818e | |||
| b2ef003fcf | |||
| f3a1e4c9a7 | |||
| c24852f7c3 | |||
| 4efe4dc941 | |||
| db04e6f686 |
@@ -1,4 +1,4 @@
|
|||||||
name: CI
|
name: Project CI-testing
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -6,19 +6,43 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
preflight_debug:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
#region agent log
|
||||||
|
- name: Print caller variable resolution
|
||||||
|
run: |
|
||||||
|
echo "DBG_CALLER_RUN_BUILD='${{ vars.RUN_BUILD }}'"
|
||||||
|
echo "DBG_CALLER_RUN_QUALITY='${{ vars.RUN_QUALITY }}'"
|
||||||
|
echo "DBG_CALLER_RUN_DEPLOY='${{ vars.RUN_DEPLOY }}'"
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
needs_probe:
|
||||||
|
needs: [preflight_debug]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
#region agent log
|
||||||
|
- name: Probe non-reusable needs chaining
|
||||||
|
run: |
|
||||||
|
echo "DBG_NEEDS_PROBE='after_preflight_ok'"
|
||||||
|
#endregion
|
||||||
|
|
||||||
ci:
|
ci:
|
||||||
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/ci.yml@baedab602ca859a71cd77af59b5e4d21d6f7067a
|
needs: [preflight_debug]
|
||||||
|
# Pin SHA (bump when wdipl-actions ci.yml changes). Propagates ci_steps via build workflow outputs.
|
||||||
|
uses: Rajendra.Reddy/wdipl-actions/.gitea/workflows/ci.yml@50e2b8b36ec570d51f406f3e6620fea6c927f850
|
||||||
|
|
||||||
with:
|
with:
|
||||||
tech_stack: node
|
tech_stack: node
|
||||||
|
|
||||||
run_build: 'true'
|
# Use repository variables in Gitea UI:
|
||||||
run_sonar: 'true'
|
# RUN_BUILD=true|false, RUN_QUALITY=true|false, RUN_DEPLOY=true|false
|
||||||
run_deploy: 'true'
|
run_build: ${{ vars.RUN_BUILD }}
|
||||||
|
run_quality: ${{ vars.RUN_QUALITY }}
|
||||||
|
run_deploy: ${{ vars.RUN_DEPLOY }}
|
||||||
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
|
||||||
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
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 }}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
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
|
|
||||||
10
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
# Node modules
|
# Node modules
|
||||||
node_modules/
|
node_modules
|
||||||
|
*.env**
|
||||||
|
*.env
|
||||||
# Logs
|
# Logs
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
@@ -8,11 +9,11 @@ yarn-error.log*
|
|||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
# Enviroment files
|
# Environment files
|
||||||
.env
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
.env.*.production
|
|
||||||
# Build output
|
# Build output
|
||||||
dist/
|
dist/
|
||||||
build/
|
build/
|
||||||
@@ -30,3 +31,4 @@ Thumbs.db
|
|||||||
|
|
||||||
# Temporary
|
# Temporary
|
||||||
*.tmp
|
*.tmp
|
||||||
|
package-lock.json
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 289 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 318 KiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 260 KiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 586 KiB After Width: | Height: | Size: 6.4 MiB |
|
Before Width: | Height: | Size: 253 KiB After Width: | Height: | Size: 4.2 MiB |
|
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 4.3 MiB |
|
Before Width: | Height: | Size: 377 KiB After Width: | Height: | Size: 3.6 MiB |
|
Before Width: | Height: | Size: 295 KiB After Width: | Height: | Size: 3.3 MiB |
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 284 KiB After Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 320 KiB After Width: | Height: | Size: 3.5 MiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 586 KiB After Width: | Height: | Size: 6.4 MiB |
|
Before Width: | Height: | Size: 255 KiB After Width: | Height: | Size: 3.8 MiB |
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 457 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 363 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 289 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 219 KiB After Width: | Height: | Size: 2.8 MiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 513 KiB After Width: | Height: | Size: 4.6 MiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 261 KiB After Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 4.7 MiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 562 KiB After Width: | Height: | Size: 4.1 MiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 258 KiB After Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 323 KiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 354 KiB After Width: | Height: | Size: 4.5 MiB |
|
Before Width: | Height: | Size: 162 KiB After Width: | Height: | Size: 778 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 387 KiB |
|
Before Width: | Height: | Size: 231 KiB After Width: | Height: | Size: 3.3 MiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 53 KiB |