From ffe69bd9ef73b2b70897ae32ad84e71d34fa40ba Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Thu, 18 Sep 2025 19:50:33 +0530 Subject: [PATCH 01/27] wip:deploy action for build and deploy --- .github/workflows/buid_deploy.yml | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/buid_deploy.yml diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml new file mode 100644 index 0000000000..3c26af0d07 --- /dev/null +++ b/.github/workflows/buid_deploy.yml @@ -0,0 +1,41 @@ +name: Build and Deploy + +on: + push: + branches: [lince/test-deploy] + workflow_dispatch: # Allows manual triggering + +jobs: + build-and-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: "18" + cache: "npm" + + - name: Install dependencies + run: npm ci + working-directory: ./frontend + + - name: Build project + run: npm run build + working-directory: ./frontend + + - name: Setup SSH + uses: webfactory/ssh-agent@v0.8.0 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Add server to known hosts + run: | + ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts + + - name: Deploy to server + run: | + rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/lince_test_deploy/ From 5393ac8176be8122a165cbed9ea7ff61750cb7ab Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Thu, 18 Sep 2025 21:40:25 +0530 Subject: [PATCH 02/27] testing deployment --- .github/workflows/buid_deploy.yml | 100 ++++++++++++++++-- .../_CssInlinerForEmail.tsx | 2 +- 2 files changed, 95 insertions(+), 7 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 3c26af0d07..25e859dc17 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -12,30 +12,118 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + fetch-depth: 2 # Fetch last 2 commits to compare + + - name: Check for changes in tool pages + id: check-changes + run: | + echo "🔍 Checking for changes in frontend/src/pages/t/..." + + # Get changed files in the last commit, filter for frontend/src/pages/t/ + changed=$(git diff --name-only HEAD~1 HEAD | grep "^frontend/src/pages/t/" || true) + + if [ -n "$changed" ]; then + echo "📦 Changes detected:" + echo "$changed" | sed 's/^/ - /' + echo "Proceeding with build and deploy..." + echo "should_deploy=true" >> $GITHUB_OUTPUT + else + echo "❌ No changes detected in frontend/src/pages/t/. Skipping build and deploy." + echo "should_deploy=false" >> $GITHUB_OUTPUT + fi - name: Setup Node.js + if: steps.check-changes.outputs.should_deploy == 'true' uses: actions/setup-node@v4 with: node-version: "18" cache: "npm" + cache-dependency-path: ./frontend/package-lock.json + + - name: Create temporary build environment + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "Creating temporary build environment..." + TMP_DIR="./tmp_build" + rm -rf $TMP_DIR ./frontend/dist + mkdir -p $TMP_DIR/src/pages + mkdir -p $TMP_DIR/public + + - name: Copy essential files + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "Copying essential files..." + TMP_DIR="./tmp_build" + cd frontend - - name: Install dependencies - run: npm ci - working-directory: ./frontend + rsync -aL --prune-empty-dirs \ + --include="package.json" \ + --include="package-lock.json" \ + --include="astro.config.mjs" \ + --include="tailwind.config.js" \ + --include="tsconfig.json" \ + --include="components.json" \ + --include="src/" \ + --include="src/assets/**" \ + --include="src/components/**" \ + --include="src/config/**" \ + --include="src/layouts/**" \ + --include="src/lib/**" \ + --include="src/styles/**" \ + --include="src/content.config.ts" \ + --include="public/**" \ + --exclude="*" \ + ./ ../$TMP_DIR/ - - name: Build project - run: npm run build - working-directory: ./frontend + - name: Copy tool pages + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "Copying tool pages..." + TMP_DIR="./tmp_build" + cd frontend + rsync -aL src/pages/t/ ../$TMP_DIR/src/pages/t/ + cp src/pages/index.astro ../$TMP_DIR/src/pages/index.astro 2>/dev/null || true + + - name: Install dependencies and build + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "Installing dependencies and building..." + cd tmp_build + npm install --omit=dev + npx astro build + + - name: Copy build artifacts + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "Copying build artifacts..." + rsync -aL tmp_build/dist/ ./frontend/dist/ - name: Setup SSH + if: steps.check-changes.outputs.should_deploy == 'true' uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Add server to known hosts + if: steps.check-changes.outputs.should_deploy == 'true' run: | ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts - name: Deploy to server + if: steps.check-changes.outputs.should_deploy == 'true' run: | + echo "🚀 Deploying to server..." rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/lince_test_deploy/ + + - name: Cleanup + if: steps.check-changes.outputs.should_deploy == 'true' + run: | + echo "✅ Cleaning up..." + rm -rf tmp_build + echo "🎉 Tool deployment complete!" + + - name: Skip deployment message + if: steps.check-changes.outputs.should_deploy == 'false' + run: | + echo "⏭️ Skipping deployment - no changes in frontend/src/pages/t/" diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index ecbfe70332..d8b922c12e 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML + // Create a DOM parser to work with the HTML file const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 5cbf359ab4884c0e03affecee9151b10a960d9c1 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Thu, 18 Sep 2025 21:44:01 +0530 Subject: [PATCH 03/27] fix: install all dependencies for build process --- .github/workflows/buid_deploy.yml | 2 +- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 25e859dc17..c9a55278f2 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -90,7 +90,7 @@ jobs: run: | echo "Installing dependencies and building..." cd tmp_build - npm install --omit=dev + npm install npx astro build - name: Copy build artifacts diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index d8b922c12e..ecbfe70332 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML file + // Create a DOM parser to work with the HTML const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From cf8f0451fb11148d3b0861d272b7df98319f4402 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Thu, 18 Sep 2025 21:46:41 +0530 Subject: [PATCH 04/27] fix: include tools configuration in build process --- .github/workflows/buid_deploy.yml | 1 + .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index c9a55278f2..4dea3aca59 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -68,6 +68,7 @@ jobs: --include="src/assets/**" \ --include="src/components/**" \ --include="src/config/**" \ + --include="src/config/tools" \ --include="src/layouts/**" \ --include="src/lib/**" \ --include="src/styles/**" \ diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index ecbfe70332..d8b922c12e 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML + // Create a DOM parser to work with the HTML file const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 6e38b493b788787302141eb59a5bb4ac70c20f40 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Thu, 18 Sep 2025 21:50:32 +0530 Subject: [PATCH 05/27] fix: correct file reference in build process and fix typo in comment --- .github/workflows/buid_deploy.yml | 2 +- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 4dea3aca59..79608c8096 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -68,7 +68,7 @@ jobs: --include="src/assets/**" \ --include="src/components/**" \ --include="src/config/**" \ - --include="src/config/tools" \ + --include="src/config/tools.ts" \ --include="src/layouts/**" \ --include="src/lib/**" \ --include="src/styles/**" \ diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index d8b922c12e..917b32bb20 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML file + // Create a DOM parser to work with the HTML fie const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 1f6f235e14f2db1ef981efb4141b463a4a8cbda0 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 19:58:29 +0530 Subject: [PATCH 06/27] fix: deploy statregy add underscore to ignore --- .github/workflows/buid_deploy.yml | 76 +++++++++++-------------------- 1 file changed, 27 insertions(+), 49 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 79608c8096..1cbedd8db0 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -41,64 +41,43 @@ jobs: cache: "npm" cache-dependency-path: ./frontend/package-lock.json - - name: Create temporary build environment + - name: Exclude non-tool pages from build if: steps.check-changes.outputs.should_deploy == 'true' run: | - echo "Creating temporary build environment..." - TMP_DIR="./tmp_build" - rm -rf $TMP_DIR ./frontend/dist - mkdir -p $TMP_DIR/src/pages - mkdir -p $TMP_DIR/public + echo "🔧 Excluding non-tool pages from build by adding underscores..." + cd frontend/src/pages - - name: Copy essential files - if: steps.check-changes.outputs.should_deploy == 'true' - run: | - echo "Copying essential files..." - TMP_DIR="./tmp_build" - cd frontend - - rsync -aL --prune-empty-dirs \ - --include="package.json" \ - --include="package-lock.json" \ - --include="astro.config.mjs" \ - --include="tailwind.config.js" \ - --include="tsconfig.json" \ - --include="components.json" \ - --include="src/" \ - --include="src/assets/**" \ - --include="src/components/**" \ - --include="src/config/**" \ - --include="src/config/tools.ts" \ - --include="src/layouts/**" \ - --include="src/lib/**" \ - --include="src/styles/**" \ - --include="src/content.config.ts" \ - --include="public/**" \ - --exclude="*" \ - ./ ../$TMP_DIR/ - - - name: Copy tool pages - if: steps.check-changes.outputs.should_deploy == 'true' - run: | - echo "Copying tool pages..." - TMP_DIR="./tmp_build" - cd frontend - rsync -aL src/pages/t/ ../$TMP_DIR/src/pages/t/ - cp src/pages/index.astro ../$TMP_DIR/src/pages/index.astro 2>/dev/null || true + # Find all directories except 't' and add underscore prefix if not already present + for dir in */; do + if [ -d "$dir" ] && [ "$dir" != "t/" ] && [[ "$dir" != _* ]]; then + echo "Renaming $dir to _$dir" + mv "$dir" "_$dir" + fi + done - name: Install dependencies and build if: steps.check-changes.outputs.should_deploy == 'true' run: | - echo "Installing dependencies and building..." - cd tmp_build + echo "📦 Installing dependencies and building..." + cd frontend npm install npx astro build - - name: Copy build artifacts + - name: Restore original folder structure if: steps.check-changes.outputs.should_deploy == 'true' run: | - echo "Copying build artifacts..." - rsync -aL tmp_build/dist/ ./frontend/dist/ + echo "🔄 Restoring original folder structure..." + cd frontend/src/pages + + # Remove underscores from directories + for dir in _*/; do + if [ -d "$dir" ]; then + original_name=${dir#_} # Remove leading underscore + original_name=${original_name%/} # Remove trailing slash + echo "Restoring _$original_name to $original_name" + mv "$dir" "$original_name/" + fi + done - name: Setup SSH if: steps.check-changes.outputs.should_deploy == 'true' @@ -120,9 +99,8 @@ jobs: - name: Cleanup if: steps.check-changes.outputs.should_deploy == 'true' run: | - echo "✅ Cleaning up..." - rm -rf tmp_build - echo "🎉 Tool deployment complete!" + echo "✅ Deployment complete!" + echo "🎉 Tool deployment successful!" - name: Skip deployment message if: steps.check-changes.outputs.should_deploy == 'false' From 394ff4aa8bf545a7f34b2bd7d89b5840be6b1a77 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:00:00 +0530 Subject: [PATCH 07/27] temp change for testing --- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 917b32bb20..ecbfe70332 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML fie + // Create a DOM parser to work with the HTML const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 5dc648e530d2bf19ba4d6018dceb76e8d335c261 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:04:19 +0530 Subject: [PATCH 08/27] fix: production env configuration --- .github/workflows/buid_deploy.yml | 1 + .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 1cbedd8db0..619a177a15 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -8,6 +8,7 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest + environment: production # This tells GitHub to use the production environment secrets steps: - name: Checkout code diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index ecbfe70332..917b32bb20 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML + // Create a DOM parser to work with the HTML fie const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 4934381eb44a3c002abecf1122539c2da7024039 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:14:04 +0530 Subject: [PATCH 09/27] fix: target path fix --- .github/workflows/buid_deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 619a177a15..a11aa344a5 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -95,7 +95,7 @@ jobs: if: steps.check-changes.outputs.should_deploy == 'true' run: | echo "🚀 Deploying to server..." - rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/lince_test_deploy/ + rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:lince_test_deploy/ - name: Cleanup if: steps.check-changes.outputs.should_deploy == 'true' From 6e8da98e8c049499dfcbe77bfe00f2b71daf4346 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:14:52 +0530 Subject: [PATCH 10/27] temp change for testing --- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 917b32bb20..ecbfe70332 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML fie + // Create a DOM parser to work with the HTML const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From 1e0cc20ad48b5b0d50fc245c7ed7822b2d8f7fb7 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:31:41 +0530 Subject: [PATCH 11/27] fix: test other section deployment --- .github/workflows/buid_deploy.yml | 98 +++++++++++++------ .../_CssInlinerForEmail.tsx | 2 +- 2 files changed, 71 insertions(+), 29 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index a11aa344a5..cd1ec73090 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -16,48 +16,89 @@ jobs: with: fetch-depth: 2 # Fetch last 2 commits to compare - - name: Check for changes in tool pages - id: check-changes + - name: Detect changed sections + id: detect-changes run: | - echo "🔍 Checking for changes in frontend/src/pages/t/..." + echo "🔍 Detecting changes in frontend/src/pages/ sections..." - # Get changed files in the last commit, filter for frontend/src/pages/t/ - changed=$(git diff --name-only HEAD~1 HEAD | grep "^frontend/src/pages/t/" || true) + # Get all changed files in frontend/src/pages/ + all_changed=$(git diff --name-only HEAD~1 HEAD | grep "^frontend/src/pages/" || true) - if [ -n "$changed" ]; then - echo "📦 Changes detected:" - echo "$changed" | sed 's/^/ - /' - echo "Proceeding with build and deploy..." + if [ -z "$all_changed" ]; then + echo "❌ No changes detected in frontend/src/pages/. Skipping build and deploy." + echo "should_deploy=false" >> $GITHUB_OUTPUT + echo "changed_sections=" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "📁 All changed files:" + echo "$all_changed" | sed 's/^/ - /' + + # Extract unique directory names from changed files + changed_dirs="" + for file in $all_changed; do + # Remove frontend/src/pages/ prefix + relative_path=${file#frontend/src/pages/} + + # Check if it's a file in a subdirectory or root + if [[ "$relative_path" == */* ]]; then + # Extract directory name (first part before /) + dir_name=$(echo "$relative_path" | cut -d'/' -f1) + # Add to changed_dirs if not already present + if [[ ! "$changed_dirs" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]]; then + changed_dirs="$changed_dirs $dir_name" + fi + fi + done + + # Clean up whitespace + changed_dirs=$(echo $changed_dirs | xargs) + + if [ -n "$changed_dirs" ]; then + echo "📦 Changed sections detected: $changed_dirs" echo "should_deploy=true" >> $GITHUB_OUTPUT + echo "changed_sections=$changed_dirs" >> $GITHUB_OUTPUT else - echo "❌ No changes detected in frontend/src/pages/t/. Skipping build and deploy." + echo "❌ No section changes detected. Skipping build and deploy." echo "should_deploy=false" >> $GITHUB_OUTPUT + echo "changed_sections=" >> $GITHUB_OUTPUT fi - name: Setup Node.js - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' uses: actions/setup-node@v4 with: node-version: "18" cache: "npm" cache-dependency-path: ./frontend/package-lock.json - - name: Exclude non-tool pages from build - if: steps.check-changes.outputs.should_deploy == 'true' + - name: Exclude unchanged sections from build + if: steps.detect-changes.outputs.should_deploy == 'true' run: | - echo "🔧 Excluding non-tool pages from build by adding underscores..." + echo "🔧 Excluding unchanged sections from build..." cd frontend/src/pages - # Find all directories except 't' and add underscore prefix if not already present + # Get the list of changed sections + changed_sections="${{ steps.detect-changes.outputs.changed_sections }}" + echo "Building only these sections: $changed_sections" + + # Find all directories and exclude those not in changed_sections for dir in */; do - if [ -d "$dir" ] && [ "$dir" != "t/" ] && [[ "$dir" != _* ]]; then - echo "Renaming $dir to _$dir" - mv "$dir" "_$dir" + if [ -d "$dir" ]; then + dir_name=${dir%/} # Remove trailing slash + + # Skip if directory name is in changed_sections or already has underscore + if [[ "$changed_sections" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]] || [[ "$dir_name" == _* ]]; then + echo "✅ Including: $dir_name" + else + echo "❌ Excluding: $dir_name -> _$dir_name" + mv "$dir" "_$dir" + fi fi done - name: Install dependencies and build - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' run: | echo "📦 Installing dependencies and building..." cd frontend @@ -65,12 +106,12 @@ jobs: npx astro build - name: Restore original folder structure - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' run: | echo "🔄 Restoring original folder structure..." cd frontend/src/pages - # Remove underscores from directories + # Remove underscores from all directories for dir in _*/; do if [ -d "$dir" ]; then original_name=${dir#_} # Remove leading underscore @@ -81,29 +122,30 @@ jobs: done - name: Setup SSH - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - name: Add server to known hosts - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' run: | ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts - name: Deploy to server - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' run: | echo "🚀 Deploying to server..." + echo "Deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:lince_test_deploy/ - name: Cleanup - if: steps.check-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' run: | echo "✅ Deployment complete!" - echo "🎉 Tool deployment successful!" + echo "🎉 Successfully deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" - name: Skip deployment message - if: steps.check-changes.outputs.should_deploy == 'false' + if: steps.detect-changes.outputs.should_deploy == 'false' run: | - echo "⏭️ Skipping deployment - no changes in frontend/src/pages/t/" + echo "⏭️ Skipping deployment - no changes detected in any frontend/src/pages/ sections" diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index ecbfe70332..912907ab93 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the HTML + // Create a DOM parser to work with the const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From c59801e2c5f70c483476c1c9bb04eeca9859ae66 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 20:52:06 +0530 Subject: [PATCH 12/27] test: cheatsheet deployment --- .../cheatsheets/utils/powershell.html | 182 +++++++++--------- 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html b/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html index f406c2125d..46efa195b2 100644 --- a/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html +++ b/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html @@ -1,6 +1,6 @@ - + PowerShell Cheatsheet - Essential Commands for Developers @@ -19,122 +19,122 @@ - - + +
-
-

PowerShell Cheatsheet

-
-
-
-

PowerShell Command Essentials

+
+

PowerShell

+
+
+
+

PowerShell Command Essentials

This cheatsheet provides essential PowerShell commands for developers to streamline their workflow. Learn how to efficiently manage files, configure your environment, and execute scripts.

-

File Management Commands

-

Create Files

-

Create a file named config:

-
New-Item config -type file
+          

File Management Commands

+

Create Files

+

Create a file named config:

+
New-Item config -type file
 
-

Delete Files and Directories

+

Delete Files and Directories

Delete everything inside the folder and subfolders (equivalent to rm -rf):

-
Remove-Item .\helm-charts\* -Recurse -Force
+          
Remove-Item .\helm-charts\* -Recurse -Force
 
-

Environment Variable Management

-

View Environment Variables

-

Show current path environment variable:

-
$env:Path
+          

Environment Variable Management

+

View Environment Variables

+

Show current path environment variable:

+
$env:Path
 
-

Modify Environment Variables

-

Append to path environment variable:

-
$env:Path += ';C:\Users\<user>\scoop\shims'
+          

Modify Environment Variables

+

Append to path environment variable:

+
$env:Path += ';C:\Users\<user>\scoop\shims'
 
-

Persistent Environment Changes

+

Persistent Environment Changes

Making changes permanent requires editing your PowerShell profile:

-
code $PROFILE
+          
code $PROFILE
 
-

Further Learning Resources

+

Further Learning Resources

For more advanced PowerShell scripting and automation, explore the official Microsoft documentation and community forums:

-
+
+
- + - + \ No newline at end of file From 8d4b047c89ae19c4a71f591beaccc49300f8eca7 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 21:43:12 +0530 Subject: [PATCH 13/27] fix: improve deployment workflow logic --- .github/workflows/buid_deploy.yml | 89 +++++++++++++++++-------------- 1 file changed, 49 insertions(+), 40 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index cd1ec73090..d99c8ed741 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -14,54 +14,74 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 2 # Fetch last 2 commits to compare + # fetch-depth: 0 is recommended for a more reliable diff across multiple commits in a push + fetch-depth: 0 - name: Detect changed sections id: detect-changes run: | - echo "🔍 Detecting changes in frontend/src/pages/ sections..." + echo "🔍 Detecting changes based on custom build rules..." - # Get all changed files in frontend/src/pages/ - all_changed=$(git diff --name-only HEAD~1 HEAD | grep "^frontend/src/pages/" || true) + # Use a more robust diff command that covers all commits in a push + all_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} || git diff --name-only HEAD~1 HEAD) if [ -z "$all_changed" ]; then - echo "❌ No changes detected in frontend/src/pages/. Skipping build and deploy." + echo "❌ No changes detected. Skipping build and deploy." echo "should_deploy=false" >> $GITHUB_OUTPUT - echo "changed_sections=" >> $GITHUB_OUTPUT exit 0 fi echo "📁 All changed files:" echo "$all_changed" | sed 's/^/ - /' - # Extract unique directory names from changed files changed_dirs="" - for file in $all_changed; do - # Remove frontend/src/pages/ prefix - relative_path=${file#frontend/src/pages/} - - # Check if it's a file in a subdirectory or root - if [[ "$relative_path" == */* ]]; then - # Extract directory name (first part before /) - dir_name=$(echo "$relative_path" | cut -d'/' -f1) - # Add to changed_dirs if not already present - if [[ ! "$changed_dirs" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]]; then - changed_dirs="$changed_dirs $dir_name" - fi + + # Helper function to add a directory to the list if it's not already there + add_dir() { + if [[ ! "$changed_dirs" =~ (^|[[:space:]])$1($|[[:space:]]) ]]; then + changed_dirs="$changed_dirs $1" fi + } + + for file in $all_changed; do + case "$file" in + frontend/src/pages/tools/*) + add_dir "t" + ;; + frontend/src/pages/markdown_pages/tldr/*|frontend/src/pages/tldr/*) + add_dir "tldr" + ;; + frontend/src/pages/html_pages/c/*|frontend/src/pages/c/*) + add_dir "c" + ;; + frontend/src/pages/svg_icons/*) + add_dir "svg_icons" + ;; + frontend/src/pages/png_icons/*) + # If png_icons changes, we build both png_icons and svg_icons + add_dir "png_icons" + add_dir "svg_icons" + ;; + frontend/src/pages/emojies/*) + add_dir "emojies" + ;; + *) + # You can add a default case here if needed, for example, to build everything + # echo "Change detected in unhandled path: $file" + ;; + esac done - # Clean up whitespace - changed_dirs=$(echo $changed_dirs | xargs) + # Clean up leading/trailing whitespace + changed_dirs=$(echo "$changed_dirs" | xargs) if [ -n "$changed_dirs" ]; then - echo "📦 Changed sections detected: $changed_dirs" + echo "📦 Changed sections to build: $changed_dirs" echo "should_deploy=true" >> $GITHUB_OUTPUT echo "changed_sections=$changed_dirs" >> $GITHUB_OUTPUT else - echo "❌ No section changes detected. Skipping build and deploy." + echo "❌ No changes matched the build rules. Skipping deployment." echo "should_deploy=false" >> $GITHUB_OUTPUT - echo "changed_sections=" >> $GITHUB_OUTPUT fi - name: Setup Node.js @@ -78,16 +98,12 @@ jobs: echo "🔧 Excluding unchanged sections from build..." cd frontend/src/pages - # Get the list of changed sections changed_sections="${{ steps.detect-changes.outputs.changed_sections }}" echo "Building only these sections: $changed_sections" - # Find all directories and exclude those not in changed_sections for dir in */; do if [ -d "$dir" ]; then - dir_name=${dir%/} # Remove trailing slash - - # Skip if directory name is in changed_sections or already has underscore + dir_name=${dir%/} if [[ "$changed_sections" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]] || [[ "$dir_name" == _* ]]; then echo "✅ Including: $dir_name" else @@ -106,16 +122,15 @@ jobs: npx astro build - name: Restore original folder structure - if: steps.detect-changes.outputs.should_deploy == 'true' + if: always() && steps.detect-changes.outputs.should_deploy == 'true' run: | echo "🔄 Restoring original folder structure..." cd frontend/src/pages - # Remove underscores from all directories for dir in _*/; do if [ -d "$dir" ]; then - original_name=${dir#_} # Remove leading underscore - original_name=${original_name%/} # Remove trailing slash + original_name=${dir#_} + original_name=${original_name%/} echo "Restoring _$original_name to $original_name" mv "$dir" "$original_name/" fi @@ -139,13 +154,7 @@ jobs: echo "Deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:lince_test_deploy/ - - name: Cleanup - if: steps.detect-changes.outputs.should_deploy == 'true' - run: | - echo "✅ Deployment complete!" - echo "🎉 Successfully deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" - - name: Skip deployment message if: steps.detect-changes.outputs.should_deploy == 'false' run: | - echo "⏭️ Skipping deployment - no changes detected in any frontend/src/pages/ sections" + echo "⏭️ Skipping deployment - no changes matched the build rules." From 8848b9803de50135ffe1633824453715effbdd3b Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Fri, 19 Sep 2025 21:47:36 +0530 Subject: [PATCH 14/27] fix: clarify comment in convertCSSToInline function --- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 912907ab93..ecbfe70332 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -21,7 +21,7 @@ const convertCSSToInline = ( preserveMediaQueries: boolean = false ): string => { try { - // Create a DOM parser to work with the + // Create a DOM parser to work with the HTML const parser = new DOMParser(); const doc = parser.parseFromString(html, "text/html"); From fead317dae0c76aa53381efef83b01f476ef3f6d Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 10:26:54 +0530 Subject: [PATCH 15/27] test: check tool only deployment --- .github/workflows/buid_deploy.yml | 2 +- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index d99c8ed741..5a97d5c182 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -152,7 +152,7 @@ jobs: run: | echo "🚀 Deploying to server..." echo "Deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" - rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:lince_test_deploy/ + rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/tools/ - name: Skip deployment message if: steps.detect-changes.outputs.should_deploy == 'false' diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index ecbfe70332..26ccba485c 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -301,7 +301,7 @@ const CssInlinerForEmail: React.FC = () => { {!loaded ? ( From 287aad4b83268d147467f5bc3358b14f1a9aadbf Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 10:32:21 +0530 Subject: [PATCH 16/27] test: check tool only deployment --- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 26ccba485c..29f5dbfe50 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -301,7 +301,7 @@ const CssInlinerForEmail: React.FC = () => { {!loaded ? ( From 946e4b1e1d45da7f1d2abcbc7a8d147872d54349 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 10:35:59 +0530 Subject: [PATCH 17/27] test: check tool only deployment --- .github/workflows/buid_deploy.yml | 2 +- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 5a97d5c182..b96bd1bbee 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -45,7 +45,7 @@ jobs: for file in $all_changed; do case "$file" in - frontend/src/pages/tools/*) + frontend/src/pages/t/*) add_dir "t" ;; frontend/src/pages/markdown_pages/tldr/*|frontend/src/pages/tldr/*) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 29f5dbfe50..26ccba485c 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -301,7 +301,7 @@ const CssInlinerForEmail: React.FC = () => { {!loaded ? ( From fb1083a4210b4fdf2666be6b1c231da7959c0a5c Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:19:39 +0530 Subject: [PATCH 18/27] test: check tool only deployment --- .../src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 26ccba485c..29f5dbfe50 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -301,7 +301,7 @@ const CssInlinerForEmail: React.FC = () => { {!loaded ? ( From 8245a0711f2a8baaef95887af83878ccf8aca8a9 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:32:46 +0530 Subject: [PATCH 19/27] test: check cheatsheet only deployment --- .../opsgenie_host_alert_rules.html | 551 ++++++++++++------ 1 file changed, 380 insertions(+), 171 deletions(-) diff --git a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html index 38e1d87c6c..c332ad01e7 100644 --- a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html +++ b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html @@ -1,174 +1,360 @@ - + - - - + + + Prometheus Host Alert Rules - Monitor Node Status - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - + +
-
-

Prometheus Host Alert Rules

-
-
-

These Prometheus alert rules are designed to monitor the status of your nodes. An alert is triggered if a node becomes unreachable for more than one minute, ensuring timely intervention and minimizing potential downtime.

+
+

Prometheus

+
+
+

+ These Prometheus alert rules are designed to monitor the status of + your nodes. An alert is triggered if a node becomes unreachable for + more than one minute, ensuring timely intervention and minimizing + potential downtime. +

-

Understanding Prometheus Alerting

-

Prometheus is a powerful monitoring and alerting toolkit. These alert rules leverage Prometheus's capabilities to provide real-time insights into the health and availability of your infrastructure.

+

Understanding Prometheus Alerting

+

+ Prometheus is a powerful monitoring and alerting toolkit. These alert + rules leverage Prometheus's capabilities to provide real-time insights + into the health and availability of your infrastructure. +

-

Alert Rules Configuration

-

Below is the configuration for the host alert rules. This YAML configuration defines the conditions under which alerts are triggered, as well as the associated labels and annotations that provide context and guidance for resolving the issue.

+

Alert Rules Configuration

+

+ Below is the configuration for the host alert rules. This YAML + configuration defines the conditions under which alerts are triggered, + as well as the associated labels and annotations that provide context + and guidance for resolving the issue. +

-
groups:
+        
groups:
 - name: host_alert_rules.yml
   rules:
 
@@ -189,23 +375,46 @@ 

Alert Rules Configuration

priority: P2
-

Analyzing the Alert Logic

-

The node_down alert is triggered when the up metric, collected by the node-exporter job, reports a value of 0. This indicates that the node is not responding. The for: 1m parameter ensures that the alert is only triggered after the node has been down for a full minute, preventing false positives due to transient network issues.

+

Analyzing the Alert Logic

+

+ The node_down alert is triggered when the + up metric, collected by the + node-exporter job, reports a value of 0. This indicates + that the node is not responding. The for: 1m parameter + ensures that the alert is only triggered after the node has been down + for a full minute, preventing false positives due to transient network + issues. +

-

Further Reading

-

To deepen your understanding of Prometheus alerting and monitoring, consider exploring the following resources:

- - -
+

Further Reading

+

+ To deepen your understanding of Prometheus alerting and monitoring, + consider exploring the following resources: +

+ +
- + From 8cbf8e2c6da765964163cf173755709d66419ace Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:36:39 +0530 Subject: [PATCH 20/27] test: check cheatsheet only deployment --- .github/workflows/buid_deploy.yml | 3 ++- .../cheatsheets/alertmanager/opsgenie_host_alert_rules.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index b96bd1bbee..2e735577d9 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -51,7 +51,8 @@ jobs: frontend/src/pages/markdown_pages/tldr/*|frontend/src/pages/tldr/*) add_dir "tldr" ;; - frontend/src/pages/html_pages/c/*|frontend/src/pages/c/*) + frontend/src/pages/html_pages/cheatsheets/*|frontend/src/pages/c/*) + add_dir "cheatsheets" add_dir "c" ;; frontend/src/pages/svg_icons/*) diff --git a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html index c332ad01e7..f2141f79ff 100644 --- a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html +++ b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html @@ -329,7 +329,7 @@
-

Prometheus

+

Prometheus Host

From 8e7825e53459392e9923f20f88f4b8fc40b1d8d3 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:42:03 +0530 Subject: [PATCH 21/27] test: check cheatsheet only deployment --- .github/workflows/buid_deploy.yml | 3 ++- .../cheatsheets/alertmanager/opsgenie_host_alert_rules.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 2e735577d9..c5db0ad3ca 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -49,10 +49,11 @@ jobs: add_dir "t" ;; frontend/src/pages/markdown_pages/tldr/*|frontend/src/pages/tldr/*) + add_dir "markdown_pages" add_dir "tldr" ;; frontend/src/pages/html_pages/cheatsheets/*|frontend/src/pages/c/*) - add_dir "cheatsheets" + add_dir "html_pages" add_dir "c" ;; frontend/src/pages/svg_icons/*) diff --git a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html index f2141f79ff..8ff082e171 100644 --- a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html +++ b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html @@ -329,7 +329,7 @@

-

Prometheus Host

+

Prometheus Host Alert

From c8e86ef741a9bf2caf3fdaa0cf15f3561dd27546 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:45:15 +0530 Subject: [PATCH 22/27] test: check cheatsheet only deployment --- .../cheatsheets/alertmanager/opsgenie_host_alert_rules.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html index 8ff082e171..963e81f3c0 100644 --- a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html +++ b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html @@ -329,7 +329,7 @@

-

Prometheus Host Alert

+

Prometheus Host Alert Rules

From a1dd768b17b0e984e2cfbf3516e9c2d81a284a8b Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 11:49:56 +0530 Subject: [PATCH 23/27] test: check tldr only deployment --- .../markdown_pages/tldr/adb/adb-connect.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md b/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md index f39d9e6258..aa37e4d653 100644 --- a/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md +++ b/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md @@ -6,27 +6,27 @@ canonical: "https://hexmos.com/freedevtools/tldr/adb/adb-connect/" description: "Connect to Android devices wirelessly with ADB Connect. Easily pair and manage device connections via the command line. Free online tool, no registration required." category: common keywords: -- adb connect -- android adb connect -- wireless android connection -- adb device connection -- android debugging bridge -- adb pair -- adb disconnect -- android device management -- linux adb connect -- macos adb connect + - adb connect + - android adb connect + - wireless android connection + - adb device connection + - android debugging bridge + - adb pair + - adb disconnect + - android device management + - linux adb connect + - macos adb connect features: -- Establish wireless connections to Android devices -- Pair devices using IP address and pairing code -- Disconnect specific Android devices -- Manage multiple Android device connections simultaneously -- Connect to Android devices via the command line + - Establish wireless connections to Android devices + - Pair devices using IP address and pairing code + - Disconnect specific Android devices + - Manage multiple Android device connections simultaneously + - Connect to Android devices via the command line ogImage: "https://hexmos.com/freedevtools/t/tool-banners/json-utilities-banner.png" twitterImage: "https://hexmos.com/freedevtools/t/tool-banners/json-utilities-banner.png" --- -# adb connect +# adb > Connect to an Android device wirelessly. > More information: . From 3b0ed688fa3ae11bdc469130e214fe2672bf4027 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 14:37:49 +0530 Subject: [PATCH 24/27] feat: enhance deployment logic to handle public assets and selective builds --- .github/workflows/buid_deploy.yml | 46 +++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index c5db0ad3ca..22d80b2136 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -67,6 +67,14 @@ jobs: frontend/src/pages/emojies/*) add_dir "emojies" ;; + frontend/public/*) + # Public assets are served directly, just sync without rebuild + add_dir "public_assets_only" + ;; + frontend/src/*) + # Other src changes (components, layouts, styles, etc.) need full rebuild + add_dir "full_rebuild" + ;; *) # You can add a default case here if needed, for example, to build everything # echo "Change detected in unhandled path: $file" @@ -103,20 +111,25 @@ jobs: changed_sections="${{ steps.detect-changes.outputs.changed_sections }}" echo "Building only these sections: $changed_sections" - for dir in */; do - if [ -d "$dir" ]; then - dir_name=${dir%/} - if [[ "$changed_sections" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]] || [[ "$dir_name" == _* ]]; then - echo "✅ Including: $dir_name" - else - echo "❌ Excluding: $dir_name -> _$dir_name" - mv "$dir" "_$dir" + # Only exclude sections if we're doing selective page builds + if [[ "$changed_sections" != "full_rebuild" && "$changed_sections" != "public_assets_only" ]]; then + for dir in */; do + if [ -d "$dir" ]; then + dir_name=${dir%/} + if [[ "$changed_sections" =~ (^|[[:space:]])$dir_name($|[[:space:]]) ]] || [[ "$dir_name" == _* ]]; then + echo "✅ Including: $dir_name" + else + echo "❌ Excluding: $dir_name -> _$dir_name" + mv "$dir" "_$dir" + fi fi - fi - done + done + else + echo "🔧 Building all sections (full rebuild or components/styles changed)" + fi - name: Install dependencies and build - if: steps.detect-changes.outputs.should_deploy == 'true' + if: steps.detect-changes.outputs.should_deploy == 'true' && steps.detect-changes.outputs.changed_sections != 'public_assets_only' run: | echo "📦 Installing dependencies and building..." cd frontend @@ -154,7 +167,16 @@ jobs: run: | echo "🚀 Deploying to server..." echo "Deployed sections: ${{ steps.detect-changes.outputs.changed_sections }}" - rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/tools/ + + changed_sections="${{ steps.detect-changes.outputs.changed_sections }}" + + if [[ "$changed_sections" == "public_assets_only" ]]; then + echo "📁 Only public assets changed - syncing files only" + rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/public/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/tools/ + else + echo "📦 Full deployment" + rsync -rvz --no-perms --no-owner --no-group --no-times --progress ./frontend/dist/ ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:/tools/ + fi - name: Skip deployment message if: steps.detect-changes.outputs.should_deploy == 'false' From e6e62e7e1d180e71017bcd5800c0094f5e1c623a Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 14:40:46 +0530 Subject: [PATCH 25/27] test: check icons only deployment --- frontend/src/pages/svg_icons/index.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/pages/svg_icons/index.astro b/frontend/src/pages/svg_icons/index.astro index c086efeed1..0968279fe7 100644 --- a/frontend/src/pages/svg_icons/index.astro +++ b/frontend/src/pages/svg_icons/index.astro @@ -9,7 +9,7 @@ import type { CollectionEntry } from 'astro:content'; const ITEMS_PER_PAGE = 30; async function getAllIcons() { - // Load the clustor.json file + // Load the clustor.json file const fs = await import('fs/promises'); const path = await import('path'); From 4a5defd3185d73f1f3b779c68a9b9b6902b2868c Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 14:53:31 +0530 Subject: [PATCH 26/27] exclude tldr from building while component, lib changes --- .github/workflows/buid_deploy.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/buid_deploy.yml b/.github/workflows/buid_deploy.yml index 22d80b2136..e3274166ff 100644 --- a/.github/workflows/buid_deploy.yml +++ b/.github/workflows/buid_deploy.yml @@ -124,8 +124,22 @@ jobs: fi fi done + elif [[ "$changed_sections" == "full_rebuild" ]]; then + # For components/lib changes, exclude tldr but build everything else + echo "🔧 Building all sections except tldr (components/styles/lib changed)" + for dir in */; do + if [ -d "$dir" ]; then + dir_name=${dir%/} + if [[ "$dir_name" == "tldr" ]]; then + echo "❌ Excluding: $dir_name -> _$dir_name" + mv "$dir" "_$dir" + else + echo "✅ Including: $dir_name" + fi + fi + done else - echo "🔧 Building all sections (full rebuild or components/styles changed)" + echo "🔧 Building all sections (public assets only)" fi - name: Install dependencies and build From eba9043dd4ed01ee9bd43b1a4583c0c39bacbc18 Mon Sep 17 00:00:00 2001 From: Lince Mathew Date: Sat, 20 Sep 2025 15:04:54 +0530 Subject: [PATCH 27/27] fix: revert testing changes --- .../opsgenie_host_alert_rules.html | 553 ++++++------------ .../cheatsheets/utils/powershell.html | 182 +++--- .../markdown_pages/tldr/adb/adb-connect.md | 34 +- frontend/src/pages/svg_icons/index.astro | 2 +- .../_CssInlinerForEmail.tsx | 2 +- 5 files changed, 282 insertions(+), 491 deletions(-) diff --git a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html index 963e81f3c0..5571e0c334 100644 --- a/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html +++ b/frontend/src/pages/html_pages/cheatsheets/alertmanager/opsgenie_host_alert_rules.html @@ -1,360 +1,174 @@ - + - - - + + + Prometheus Host Alert Rules - Monitor Node Status - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - - + +

-
-

Prometheus Host Alert Rules

-
-
-

- These Prometheus alert rules are designed to monitor the status of - your nodes. An alert is triggered if a node becomes unreachable for - more than one minute, ensuring timely intervention and minimizing - potential downtime. -

+
+

Prometheus Host Alert Rules

+
+
+

These Prometheus alert rules are designed to monitor the status of your nodes. An alert is triggered if a node becomes unreachable for more than one minute, ensuring timely intervention and minimizing potential downtime.

-

Understanding Prometheus Alerting

-

- Prometheus is a powerful monitoring and alerting toolkit. These alert - rules leverage Prometheus's capabilities to provide real-time insights - into the health and availability of your infrastructure. -

+

Understanding Prometheus Alerting

+

Prometheus is a powerful monitoring and alerting toolkit. These alert rules leverage Prometheus's capabilities to provide real-time insights into the health and availability of your infrastructure.

-

Alert Rules Configuration

-

- Below is the configuration for the host alert rules. This YAML - configuration defines the conditions under which alerts are triggered, - as well as the associated labels and annotations that provide context - and guidance for resolving the issue. -

+

Alert Rules Configuration

+

Below is the configuration for the host alert rules. This YAML configuration defines the conditions under which alerts are triggered, as well as the associated labels and annotations that provide context and guidance for resolving the issue.

-
groups:
+            
groups:
 - name: host_alert_rules.yml
   rules:
 
@@ -375,46 +189,23 @@ 

Alert Rules Configuration

priority: P2
-

Analyzing the Alert Logic

-

- The node_down alert is triggered when the - up metric, collected by the - node-exporter job, reports a value of 0. This indicates - that the node is not responding. The for: 1m parameter - ensures that the alert is only triggered after the node has been down - for a full minute, preventing false positives due to transient network - issues. -

+

Analyzing the Alert Logic

+

The node_down alert is triggered when the up metric, collected by the node-exporter job, reports a value of 0. This indicates that the node is not responding. The for: 1m parameter ensures that the alert is only triggered after the node has been down for a full minute, preventing false positives due to transient network issues.

-

Further Reading

-

- To deepen your understanding of Prometheus alerting and monitoring, - consider exploring the following resources: -

- -
+

Further Reading

+

To deepen your understanding of Prometheus alerting and monitoring, consider exploring the following resources:

+ + +
- - + + \ No newline at end of file diff --git a/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html b/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html index 46efa195b2..f406c2125d 100644 --- a/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html +++ b/frontend/src/pages/html_pages/cheatsheets/utils/powershell.html @@ -1,6 +1,6 @@ - + PowerShell Cheatsheet - Essential Commands for Developers @@ -19,122 +19,122 @@ - - + +
-
-

PowerShell

-
-
-
-

PowerShell Command Essentials

+
+

PowerShell Cheatsheet

+
+
+
+

PowerShell Command Essentials

This cheatsheet provides essential PowerShell commands for developers to streamline their workflow. Learn how to efficiently manage files, configure your environment, and execute scripts.

-

File Management Commands

-

Create Files

-

Create a file named config:

-
New-Item config -type file
+                

File Management Commands

+

Create Files

+

Create a file named config:

+
New-Item config -type file
 
-

Delete Files and Directories

+

Delete Files and Directories

Delete everything inside the folder and subfolders (equivalent to rm -rf):

-
Remove-Item .\helm-charts\* -Recurse -Force
+                
Remove-Item .\helm-charts\* -Recurse -Force
 
-

Environment Variable Management

-

View Environment Variables

-

Show current path environment variable:

-
$env:Path
+                

Environment Variable Management

+

View Environment Variables

+

Show current path environment variable:

+
$env:Path
 
-

Modify Environment Variables

-

Append to path environment variable:

-
$env:Path += ';C:\Users\<user>\scoop\shims'
+                

Modify Environment Variables

+

Append to path environment variable:

+
$env:Path += ';C:\Users\<user>\scoop\shims'
 
-

Persistent Environment Changes

+

Persistent Environment Changes

Making changes permanent requires editing your PowerShell profile:

-
code $PROFILE
+                
code $PROFILE
 
-

Further Learning Resources

+

Further Learning Resources

For more advanced PowerShell scripting and automation, explore the official Microsoft documentation and community forums:

- +
-
- + - + \ No newline at end of file diff --git a/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md b/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md index aa37e4d653..dd26a0993d 100644 --- a/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md +++ b/frontend/src/pages/markdown_pages/tldr/adb/adb-connect.md @@ -6,27 +6,27 @@ canonical: "https://hexmos.com/freedevtools/tldr/adb/adb-connect/" description: "Connect to Android devices wirelessly with ADB Connect. Easily pair and manage device connections via the command line. Free online tool, no registration required." category: common keywords: - - adb connect - - android adb connect - - wireless android connection - - adb device connection - - android debugging bridge - - adb pair - - adb disconnect - - android device management - - linux adb connect - - macos adb connect +- adb connect +- android adb connect +- wireless android connection +- adb device connection +- android debugging bridge +- adb pair +- adb disconnect +- android device management +- linux adb connect +- macos adb connect features: - - Establish wireless connections to Android devices - - Pair devices using IP address and pairing code - - Disconnect specific Android devices - - Manage multiple Android device connections simultaneously - - Connect to Android devices via the command line +- Establish wireless connections to Android devices +- Pair devices using IP address and pairing code +- Disconnect specific Android devices +- Manage multiple Android device connections simultaneously +- Connect to Android devices via the command line ogImage: "https://hexmos.com/freedevtools/t/tool-banners/json-utilities-banner.png" twitterImage: "https://hexmos.com/freedevtools/t/tool-banners/json-utilities-banner.png" --- -# adb +# adb connect > Connect to an Android device wirelessly. > More information: . @@ -41,4 +41,4 @@ twitterImage: "https://hexmos.com/freedevtools/t/tool-banners/json-utilities-ban - Disconnect a device: -`adb disconnect {{ip_address}}:{{port}}` +`adb disconnect {{ip_address}}:{{port}}` \ No newline at end of file diff --git a/frontend/src/pages/svg_icons/index.astro b/frontend/src/pages/svg_icons/index.astro index 0968279fe7..c086efeed1 100644 --- a/frontend/src/pages/svg_icons/index.astro +++ b/frontend/src/pages/svg_icons/index.astro @@ -9,7 +9,7 @@ import type { CollectionEntry } from 'astro:content'; const ITEMS_PER_PAGE = 30; async function getAllIcons() { - // Load the clustor.json file + // Load the clustor.json file const fs = await import('fs/promises'); const path = await import('path'); diff --git a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx index 29f5dbfe50..ecbfe70332 100644 --- a/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx +++ b/frontend/src/pages/t/css-inliner-for-email/_CssInlinerForEmail.tsx @@ -301,7 +301,7 @@ const CssInlinerForEmail: React.FC = () => { {!loaded ? (