Skip to content

Commit 1d22b49

Browse files
✨ Create required files
1 parent 7d0328a commit 1d22b49

File tree

1 file changed

+211
-136
lines changed

1 file changed

+211
-136
lines changed

.github/workflows/docs.yml

Lines changed: 211 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,10 @@ name: Documentation
22

33
on:
44
push:
5-
branches: [ develop, develop ]
5+
branches: [ main, develop ]
66
paths:
77
- 'docs/**'
8-
- 'README.md'
9-
- '*.md'
10-
- '.github/workflows/docs.yml'
11-
pull_request:
12-
branches: [ develop ]
13-
paths:
14-
- 'docs/**'
15-
- 'README.md'
16-
- '*.md'
8+
- '**.md'
179
- '.github/workflows/docs.yml'
1810
workflow_dispatch:
1911

@@ -23,165 +15,248 @@ permissions:
2315
id-token: write
2416

2517
concurrency:
26-
group: "pages"
27-
cancel-in-progress: true
18+
group: "pages"
19+
cancel-in-progress: false
2820

2921
jobs:
30-
lint-docs:
31-
name: Lint Documentation
22+
build:
23+
name: Build Documentation
3224
runs-on: ubuntu-latest
3325

3426
steps:
3527
- name: Checkout
3628
uses: actions/checkout@v4
3729

38-
- name: Setup Node.js
39-
uses: actions/setup-node@v4
30+
- name: Setup Ruby
31+
uses: ruby/setup-ruby@v1
4032
with:
41-
node-version: '18'
33+
ruby-version: '3.1'
34+
bundler-cache: true
4235

43-
- name: Install tools
36+
- name: Create Gemfile
4437
run: |
45-
npm install -g markdownlint-cli2
46-
npm install -g markdown-link-check
38+
cat > Gemfile << 'EOF'
39+
source "https://rubygems.org"
40+
gem "jekyll", "~> 4.3"
41+
gem "jekyll-theme-cayman"
42+
gem "jekyll-relative-links"
43+
gem "jekyll-seo-tag"
44+
gem "jekyll-sitemap"
45+
gem "jekyll-github-metadata"
46+
gem "jekyll-titles-from-headings"
47+
gem "jekyll-optional-front-matter"
48+
gem "jekyll-readme-index"
49+
gem "jekyll-default-layout"
50+
gem "kramdown-parser-gfm"
51+
EOF
4752
48-
- name: Lint Markdown files
49-
run: |
50-
markdownlint-cli2 "**/*.md" "#node_modules" "#.git" || true
53+
- name: Install dependencies
54+
run: bundle install
5155

52-
- name: Check markdown links
56+
- name: Create Jekyll config
5357
run: |
54-
find . -name "*.md" -not -path "./node_modules/*" -not -path "./.git/*" | head -10 | \
55-
xargs -I {} markdown-link-check {} || true
58+
cat > _config.yml << 'EOF'
59+
title: EKS Helm Client GitHub Action
60+
description: Deploy Helm charts to Amazon EKS clusters with private infrastructure support
61+
theme: jekyll-theme-cayman
62+
63+
# GitHub Pages settings
64+
repository: open-source-srilanka/eks-helm-client-github-action
65+
baseurl: "/eks-helm-client-github-action"
66+
url: "https://open-source-srilanka.github.io"
67+
68+
# Build settings
69+
markdown: kramdown
70+
kramdown:
71+
input: GFM
72+
hard_wrap: false
73+
74+
# Plugins
75+
plugins:
76+
- jekyll-relative-links
77+
- jekyll-seo-tag
78+
- jekyll-sitemap
79+
- jekyll-github-metadata
80+
- jekyll-titles-from-headings
81+
- jekyll-optional-front-matter
82+
- jekyll-readme-index
83+
- jekyll-default-layout
84+
85+
# Include documentation files
86+
include:
87+
- README.md
88+
- CHANGELOG.md
89+
- LICENSE.md
90+
- CODE_OF_CONDUCT.md
91+
- docs
92+
93+
# Convert README to index
94+
readme_index:
95+
enabled: true
96+
remove_originals: false
97+
98+
# Default layout
99+
defaults:
100+
- scope:
101+
path: ""
102+
values:
103+
layout: "default"
104+
- scope:
105+
path: "docs"
106+
values:
107+
layout: "default"
108+
109+
# Navigation
110+
navigation:
111+
- title: Home
112+
url: /
113+
- title: Changelog
114+
url: /CHANGELOG
115+
- title: Migration Guide
116+
url: /docs/MIGRATION
117+
- title: Examples
118+
url: /docs/examples/basic-usage
119+
- title: Security
120+
url: /docs/SECURITY
121+
- title: GitHub
122+
url: https://github.com/open-source-srilanka/eks-helm-client-github-action
123+
EOF
56124
57-
- name: Validate action.yml
125+
- name: Create minimal layout
58126
run: |
59-
python3 -c "import yaml; yaml.safe_load(open('action.yml'))"
60-
echo "✅ action.yml is valid YAML"
127+
mkdir -p _layouts
128+
cat > _layouts/default.html << 'EOF'
129+
<!DOCTYPE html>
130+
<html lang="{{ site.lang | default: "en-US" }}">
131+
<head>
132+
<meta charset="UTF-8">
133+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
134+
<meta name="viewport" content="width=device-width, initial-scale=1">
135+
{% seo %}
136+
<link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
137+
<style>
138+
.inner { max-width: 1200px; }
139+
.project-name { font-size: 2.5rem; }
140+
.navigation {
141+
margin: 1rem 0;
142+
padding: 0;
143+
list-style: none;
144+
display: flex;
145+
gap: 1rem;
146+
flex-wrap: wrap;
147+
}
148+
.navigation li { display: inline; }
149+
.navigation a {
150+
color: rgba(255,255,255,0.9);
151+
text-decoration: none;
152+
padding: 0.5rem 1rem;
153+
border-radius: 4px;
154+
transition: background-color 0.2s;
155+
}
156+
.navigation a:hover { background-color: rgba(255,255,255,0.2); }
157+
pre { overflow-x: auto; }
158+
.highlight { background-color: #f6f8fa; }
159+
code { font-size: 0.9em; }
160+
.main-content h1 { color: #0366d6; }
161+
.main-content h2 { color: #0366d6; margin-top: 2rem; }
162+
.main-content table {
163+
display: block;
164+
width: 100%;
165+
overflow: auto;
166+
border-collapse: collapse;
167+
}
168+
.main-content table th,
169+
.main-content table td {
170+
padding: 6px 13px;
171+
border: 1px solid #dfe2e5;
172+
}
173+
.main-content table tr {
174+
background-color: #fff;
175+
border-top: 1px solid #c6cbd1;
176+
}
177+
.main-content table tr:nth-child(2n) {
178+
background-color: #f6f8fa;
179+
}
180+
</style>
181+
</head>
182+
<body>
183+
<header class="page-header" role="banner">
184+
<h1 class="project-name">{{ page.title | default: site.title }}</h1>
185+
<h2 class="project-tagline">{{ page.description | default: site.description }}</h2>
186+
187+
<nav>
188+
<ul class="navigation">
189+
{% for item in site.navigation %}
190+
<li><a href="{% if item.url contains 'http' %}{{ item.url }}{% else %}{{ item.url | relative_url }}{% endif %}">{{ item.title }}</a></li>
191+
{% endfor %}
192+
</ul>
193+
</nav>
194+
195+
<a href="{{ site.github.repository_url }}" class="btn">View on GitHub</a>
196+
<a href="{{ site.github.releases_url }}/latest" class="btn">Latest Release</a>
197+
</header>
61198
62-
spell-check:
63-
name: Spell Check
64-
runs-on: ubuntu-latest
65-
66-
steps:
67-
- name: Checkout
68-
uses: actions/checkout@v4
69-
70-
- name: Install cspell
71-
run: npm install -g cspell
199+
<main id="content" class="main-content" role="main">
200+
{{ content }}
72201
73-
- name: Run spell check
74-
run: |
75-
cspell "**/*.md" --no-progress || echo "Spell check completed with warnings"
76-
77-
validate-structure:
78-
name: Validate Documentation Structure
79-
runs-on: ubuntu-latest
80-
81-
steps:
82-
- name: Checkout
83-
uses: actions/checkout@v4
202+
<footer class="site-footer">
203+
<span class="site-footer-owner">
204+
<a href="{{ site.github.repository_url }}">{{ site.github.repository_name }}</a>
205+
is maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a>.
206+
</span>
207+
<span class="site-footer-credits">
208+
Made with ❤️ & ☕ by <a href="https://dinushchathurya.me/">Dinush Chathurya</a>
209+
as a part of <a href="https://github.com/open-source-srilanka">ProjectOSS</a>
210+
</span>
211+
</footer>
212+
</main>
213+
</body>
214+
</html>
215+
EOF
84216
85-
- name: Check required files
217+
- name: Create index page
86218
run: |
87-
echo "📋 Checking required documentation files..."
219+
cat > index.md << 'EOF'
220+
---
221+
layout: default
222+
title: EKS Helm Client GitHub Action
223+
---
88224
89-
files=(
90-
"README.md"
91-
"CHANGELOG.md"
92-
"LICENSE.md"
93-
"CODE_OF_CONDUCT.md"
94-
)
225+
# Quick Links
95226
96-
for file in "${files[@]}"; do
97-
if [[ -f "$file" ]]; then
98-
echo "✅ $file"
99-
else
100-
echo "❌ Missing: $file"
101-
fi
102-
done
103-
104-
build-docs:
105-
name: Build Documentation Site
106-
runs-on: ubuntu-latest
107-
needs: [lint-docs, validate-structure]
108-
if: github.ref == 'refs/heads/develop'
109-
110-
steps:
111-
- name: Checkout
112-
uses: actions/checkout@v4
113-
114-
- name: Setup Pages
115-
uses: actions/configure-pages@v4
116-
117-
- name: Create site directory
118-
run: mkdir -p _site
119-
120-
- name: Create simple index page
121-
run: |
122-
echo '<!DOCTYPE html>' > _site/index.html
123-
echo '<html><head><title>EKS Helm Client Documentation</title></head>' >> _site/index.html
124-
echo '<body style="font-family: sans-serif; max-width: 1200px; margin: 0 auto; padding: 20px;">' >> _site/index.html
125-
echo '<h1>EKS Helm Client Documentation</h1>' >> _site/index.html
126-
echo '<p>Deploy Helm charts to EKS clusters with private infrastructure support</p>' >> _site/index.html
127-
echo '<h2>Quick Start</h2>' >> _site/index.html
128-
echo '<pre><code>uses: open-source-srilanka/eks-helm-client-github-action@v2.0.0</code></pre>' >> _site/index.html
129-
echo '<h2>Documentation</h2>' >> _site/index.html
130-
echo '<ul>' >> _site/index.html
131-
echo '<li><a href="README.html">README</a></li>' >> _site/index.html
132-
echo '<li><a href="CHANGELOG.html">Changelog</a></li>' >> _site/index.html
133-
echo '</ul>' >> _site/index.html
134-
echo '</body></html>' >> _site/index.html
227+
- 🚀 [Quick Start](#quick-start)
228+
- 📚 [Documentation](#documentation)
229+
- 🔧 [Examples](docs/examples/basic-usage)
230+
- 🔄 [Migration Guide](docs/MIGRATION)
231+
- 📋 [Changelog](CHANGELOG)
232+
233+
---
234+
235+
EOF
236+
237+
# Append README content without the title
238+
tail -n +2 README.md >> index.md
135239
136-
- name: Convert markdown to HTML
137-
run: |
138-
for file in *.md; do
139-
if [[ -f "$file" ]]; then
140-
html_file="_site/${file%.md}.html"
141-
echo "<!DOCTYPE html><html><head><title>${file%.md}</title></head><body style=\"font-family: sans-serif; padding: 20px;\">" > "$html_file"
142-
echo "<h1>${file%.md}</h1>" >> "$html_file"
143-
echo "<pre>" >> "$html_file"
144-
cat "$file" >> "$html_file"
145-
echo "</pre>" >> "$html_file"
146-
echo "</body></html>" >> "$html_file"
147-
fi
148-
done
240+
- name: Build Jekyll site
241+
run: bundle exec jekyll build --baseurl /eks-helm-client-github-action
242+
env:
243+
JEKYLL_ENV: production
149244

150245
- name: Upload artifact
151246
uses: actions/upload-pages-artifact@v3
152247
with:
153248
path: '_site'
154249

155-
deploy-docs:
156-
name: Deploy Documentation
157-
runs-on: ubuntu-latest
158-
needs: build-docs
159-
if: github.ref == 'refs/heads/develop'
160-
250+
deploy:
251+
name: Deploy to GitHub Pages
161252
environment:
162253
name: github-pages
163254
url: ${{ steps.deployment.outputs.page_url }}
255+
runs-on: ubuntu-latest
256+
needs: build
257+
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
164258

165259
steps:
166260
- name: Deploy to GitHub Pages
167261
id: deployment
168-
uses: actions/deploy-pages@v4
169-
170-
docs-summary:
171-
name: Documentation Summary
172-
runs-on: ubuntu-latest
173-
needs: [lint-docs, spell-check, validate-structure]
174-
if: always()
175-
176-
steps:
177-
- name: Generate Summary
178-
run: |
179-
echo "# Documentation Workflow Summary" >> $GITHUB_STEP_SUMMARY
180-
echo "" >> $GITHUB_STEP_SUMMARY
181-
echo "## Results" >> $GITHUB_STEP_SUMMARY
182-
echo "" >> $GITHUB_STEP_SUMMARY
183-
echo "| Check | Status |" >> $GITHUB_STEP_SUMMARY
184-
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
185-
echo "| Lint | ${{ needs.lint-docs.result == 'success' && 'Pass' || 'Fail' }} |" >> $GITHUB_STEP_SUMMARY
186-
echo "| Spell | ${{ needs.spell-check.result == 'success' && 'Pass' || 'Warn' }} |" >> $GITHUB_STEP_SUMMARY
187-
echo "| Structure | ${{ needs.validate-structure.result == 'success' && 'Pass' || 'Fail' }} |" >> $GITHUB_STEP_SUMMARY
262+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)