Upload files to "/" #9
34
.gitea/workflows/build.yml
Normal file
Protected
34
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,34 @@
|
||||
name: Klc-HR-Dashboard-Frontend-Build-Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- beta
|
||||
- testing
|
||||
- client
|
||||
- staging
|
||||
- production
|
||||
|
||||
jobs:
|
||||
build-test:
|
||||
name: Build and Test PR
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Build Check
|
||||
run: npm run build
|
||||
|
||||
- name: Audit Dependencies
|
||||
run: npm audit --audit-level=critical
|
||||
50
.gitea/workflows/compressimage.yml
Normal file
Protected
50
.gitea/workflows/compressimage.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
name: Enforce Image Standards
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- beta
|
||||
- testing
|
||||
- client
|
||||
- staging
|
||||
- production
|
||||
types: [opened, synchronize, reopened]
|
||||
paths:
|
||||
- '**/*.jpg'
|
||||
- '**/*.jpeg'
|
||||
- '**/*.png'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
optimize:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Debug Event
|
||||
run: |
|
||||
echo "Base: ${{ gitea.base_ref }}"
|
||||
echo "Head: ${{ gitea.head_ref }}"
|
||||
|
||||
- name: Install Image Tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y imagemagick jpegoptim pngquant
|
||||
|
||||
- name: Resize Oversized Images
|
||||
run: |
|
||||
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.png" \) \
|
||||
-exec mogrify -resize 1920x1920\> {} \;
|
||||
|
||||
- name: Optimize JPEG
|
||||
run: |
|
||||
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) \
|
||||
-exec jpegoptim --strip-all --max=85 {} \;
|
||||
|
||||
- name: Optimize PNG
|
||||
run: |
|
||||
find . -type f -iname "*.png" \
|
||||
-exec pngquant --force --ext .png --quality=75-90 {} \;
|
||||
77
.gitea/workflows/deploy.yml
Normal file
Protected
77
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,77 @@
|
||||
name: Klc-Learner-Frontend-CD
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- beta
|
||||
- testing
|
||||
- client
|
||||
- staging
|
||||
- production
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploying code in Server
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout Code in Runner
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Determine Project Folder
|
||||
run: |
|
||||
echo "Detected Branch Name : ${{ gitea.ref_name }}"
|
||||
BRANCH_NAME=${{ gitea.ref_name }}
|
||||
|
||||
case "$BRANCH_NAME" in
|
||||
beta)
|
||||
echo "PROJECT_FOLDER=null" >> $GITHUB_ENV
|
||||
;;
|
||||
testing)
|
||||
echo "PROJECT_FOLDER=/home/klc/klc-frontend/Test_Release/KLC-Hr-Dashboard-Frontend" >> $GITHUB_ENV
|
||||
;;
|
||||
client)
|
||||
echo "PROJECT_FOLDER=null" >> $GITHUB_ENV
|
||||
;;
|
||||
staging)
|
||||
echo "PROJECT_FOLDER=null" >> $GITHUB_ENV
|
||||
;;
|
||||
production)
|
||||
echo "PROJECT_FOLDER=null" >> $GITHUB_ENV
|
||||
;;
|
||||
*)
|
||||
echo "UNKNOWN BRANCH"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "BRANCH_NAME=${{ gitea.ref_name }}" >> $GITHUB_ENV
|
||||
|
||||
- name: Deploy Using SSH
|
||||
uses: appleboy/ssh-action@v1
|
||||
with:
|
||||
host: ${{ secrets.BETA_SERVER_HOST }}
|
||||
username: ${{ secrets.BETA_SERVER_USERNAME }}
|
||||
password: ${{ secrets.BETA_SERVER_PASSWORD }}
|
||||
port: ${{ secrets.BETA_SERVER_PORT }}
|
||||
envs: BRANCH_NAME,PROJECT_FOLDER
|
||||
script: |
|
||||
set -e
|
||||
|
||||
if [ "$PROJECT_FOLDER" = "null" ]; then
|
||||
echo "No deployment configured for this branch"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd $PROJECT_FOLDER
|
||||
|
||||
git fetch
|
||||
git reset --hard origin/$BRANCH_NAME
|
||||
git stash && git stash clear || true
|
||||
git pull origin $BRANCH_NAME
|
||||
|
||||
echo "Installing Node Modules..."
|
||||
npm install
|
||||
|
||||
echo "Building..."
|
||||
npm run build
|
||||
39
.gitea/workflows/sonar.yml
Normal file
Protected
39
.gitea/workflows/sonar.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Klc-Learner-Frontend-Sonar
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- beta
|
||||
- testing
|
||||
- client
|
||||
- staging
|
||||
- production
|
||||
|
||||
jobs:
|
||||
sonarqube:
|
||||
name: SonarQube Scan
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: sonarsource/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
|
||||
BIN
pexels-audstories-37019770.jpg
Normal file
BIN
pexels-audstories-37019770.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
BIN
pexels-kristof-sass-kovan-64832383-8798229.jpg
Normal file
BIN
pexels-kristof-sass-kovan-64832383-8798229.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
BIN
pexels-phiraphonsrithakae-20680213.jpg
Normal file
BIN
pexels-phiraphonsrithakae-20680213.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.8 MiB |
Reference in New Issue
Block a user