Skip to content

Commit d93043b

Browse files
author
hussainnazary2
committed
made website simple and easy to understand
0 parents  commit d93043b

File tree

123 files changed

+58678
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+58678
-0
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: Checkout code
22+
uses: actions/checkout@v4
23+
24+
- name: Create deployment directory
25+
run: |
26+
mkdir -p deploy
27+
# Copy essential website files
28+
cp index.html deploy/
29+
cp -r css/ deploy/css/
30+
cp -r js/ deploy/js/
31+
cp -r data/ deploy/data/
32+
cp styles.css deploy/
33+
cp styles.min.css deploy/
34+
cp manifest.json deploy/
35+
cp robots.txt deploy/
36+
cp sitemap.xml deploy/
37+
cp sitemap.html deploy/
38+
cp sw.js deploy/
39+
cp .htaccess deploy/
40+
cp _headers deploy/
41+
cp browserconfig.xml deploy/
42+
cp google23207bd4b3d5b313.html deploy/
43+
cp preview.png deploy/
44+
# Copy any HTML pages (excluding test files)
45+
find . -name "*.html" -not -path "./test-*" -not -path "./node_modules/*" -not -path "./_*" -not -path "./docs/*" -exec cp {} deploy/ \;
46+
# Fix Jekyll config baseurl issue by creating a clean config
47+
echo "# GitHub Pages deployment config" > deploy/_config.yml
48+
echo "baseurl: \"\"" >> deploy/_config.yml
49+
echo "url: \"https://ggufloader.github.io\"" >> deploy/_config.yml
50+
51+
- name: Deploy to GitHub Pages
52+
uses: peaceiris/actions-gh-pages@v3
53+
if: github.ref == 'refs/heads/main'
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
publish_dir: ./deploy
57+
publish_branch: gh-pages
58+
force_orphan: true
59+
60+
- name: Notify deployment
61+
if: github.ref == 'refs/heads/main'
62+
run: |
63+
echo "## 🚀 Deployment Completed" >> $GITHUB_STEP_SUMMARY
64+
echo "- **Commit**: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
65+
echo "- **Branch**: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
66+
echo "- **Deployed by**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY
67+
echo "- **Site URL**: https://ggufloader.github.io" >> $GITHUB_STEP_SUMMARY
68+
echo "- **Deployment time**: $(date -u)" >> $GITHUB_STEP_SUMMARY
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
name: Cross-Page Integration Maintenance
2+
3+
on:
4+
schedule:
5+
# Run daily at 2 AM UTC
6+
- cron: '0 2 * * *'
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- '_docs/**'
11+
- 'docs/**'
12+
- 'index.html'
13+
- 'includes/**'
14+
pull_request:
15+
branches: [ main ]
16+
paths:
17+
- '_docs/**'
18+
- 'docs/**'
19+
- 'index.html'
20+
- 'includes/**'
21+
workflow_dispatch:
22+
inputs:
23+
maintenance_type:
24+
description: 'Type of maintenance to run'
25+
required: true
26+
default: 'full'
27+
type: choice
28+
options:
29+
- full
30+
- links
31+
- previews
32+
- test
33+
34+
jobs:
35+
cross-page-maintenance:
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: '18'
46+
cache: 'npm'
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Run Cross-Page Maintenance Tests
52+
run: npm run test:cross-page-maintenance
53+
54+
- name: Run Link Integrity Check
55+
run: npm run maintenance:cross-page:links
56+
57+
- name: Update Content Previews
58+
run: npm run content:update-previews
59+
60+
- name: Run Full Maintenance (Scheduled)
61+
if: github.event_name == 'schedule'
62+
run: npm run maintenance:cross-page
63+
64+
- name: Run Specific Maintenance (Manual)
65+
if: github.event_name == 'workflow_dispatch'
66+
run: |
67+
case "${{ github.event.inputs.maintenance_type }}" in
68+
"links")
69+
npm run maintenance:cross-page:links
70+
;;
71+
"previews")
72+
npm run content:update-previews
73+
;;
74+
"test")
75+
npm run maintenance:cross-page:test
76+
;;
77+
*)
78+
npm run maintenance:cross-page
79+
;;
80+
esac
81+
82+
- name: Run Cross-Page Integration Tests
83+
run: npm run test:cross-page-integration
84+
85+
- name: Upload Maintenance Reports
86+
uses: actions/upload-artifact@v4
87+
if: always()
88+
with:
89+
name: maintenance-reports-${{ github.run_number }}
90+
path: |
91+
maintenance-logs/
92+
maintenance-reports/
93+
retention-days: 30
94+
95+
- name: Upload Test Results
96+
uses: actions/upload-artifact@v4
97+
if: always()
98+
with:
99+
name: test-results-${{ github.run_number }}
100+
path: |
101+
maintenance-reports/cross-page-maintenance-test-report.json
102+
retention-days: 7
103+
104+
- name: Comment PR with Results
105+
if: github.event_name == 'pull_request'
106+
uses: actions/github-script@v7
107+
with:
108+
script: |
109+
const fs = require('fs');
110+
111+
try {
112+
const reportPath = 'maintenance-reports/cross-page-maintenance-test-report.json';
113+
if (fs.existsSync(reportPath)) {
114+
const report = JSON.parse(fs.readFileSync(reportPath, 'utf8'));
115+
116+
const body = `## Cross-Page Integration Test Results
117+
118+
**Summary:**
119+
- Total Tests: ${report.summary.total}
120+
- Passed: ${report.summary.passed} ✅
121+
- Failed: ${report.summary.failed} ❌
122+
- Success Rate: ${report.summary.successRate}%
123+
124+
${report.summary.failed > 0 ? '**⚠️ Some tests failed. Please review the issues.**' : '**🎉 All tests passed!**'}
125+
126+
<details>
127+
<summary>Detailed Results</summary>
128+
129+
${report.details.map(test =>
130+
`- ${test.passed ? '✅' : '❌'} **${test.category}**: ${test.message}`
131+
).join('\n')}
132+
133+
</details>`;
134+
135+
github.rest.issues.createComment({
136+
issue_number: context.issue.number,
137+
owner: context.repo.owner,
138+
repo: context.repo.repo,
139+
body: body
140+
});
141+
}
142+
} catch (error) {
143+
console.log('Could not post test results:', error.message);
144+
}
145+
146+
- name: Fail if Critical Issues Found
147+
run: |
148+
if [ -f "maintenance-reports/cross-page-maintenance-test-report.json" ]; then
149+
FAILED_TESTS=$(node -e "
150+
const report = require('./maintenance-reports/cross-page-maintenance-test-report.json');
151+
console.log(report.summary.failed);
152+
")
153+
154+
if [ "$FAILED_TESTS" -gt "0" ]; then
155+
echo "❌ $FAILED_TESTS tests failed. Please review and fix the issues."
156+
exit 1
157+
fi
158+
fi
159+
160+
content-preview-update:
161+
runs-on: ubuntu-latest
162+
if: github.event_name == 'push' && contains(github.event.head_commit.modified, '_docs/')
163+
164+
steps:
165+
- name: Checkout repository
166+
uses: actions/checkout@v4
167+
168+
- name: Setup Node.js
169+
uses: actions/setup-node@v4
170+
with:
171+
node-version: '18'
172+
cache: 'npm'
173+
174+
- name: Install dependencies
175+
run: npm ci
176+
177+
- name: Update Content Previews
178+
run: npm run content:update-previews
179+
180+
- name: Check for Changes
181+
id: changes
182+
run: |
183+
if git diff --quiet; then
184+
echo "changes=false" >> $GITHUB_OUTPUT
185+
else
186+
echo "changes=true" >> $GITHUB_OUTPUT
187+
fi
188+
189+
- name: Commit Updated Previews
190+
if: steps.changes.outputs.changes == 'true'
191+
run: |
192+
git config --local user.email "[email protected]"
193+
git config --local user.name "GitHub Action"
194+
git add index.html
195+
git commit -m "Auto-update content previews from documentation changes" || exit 0
196+
git push

0 commit comments

Comments
 (0)