1+ name : Setup GitHub Pages
2+
3+ on :
4+ workflow_dispatch :
5+
6+ permissions :
7+ pages : write
8+ id-token : write
9+
10+ concurrency :
11+ group : " pages"
12+ cancel-in-progress : false
13+
14+ jobs :
15+ setup :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - name : Setup Pages
19+ uses : actions/configure-pages@v4
20+
21+ - name : Create index.html
22+ run : |
23+ mkdir -p dist
24+ echo '<!DOCTYPE html>' > dist/index.html
25+ echo '<html>' >> dist/index.html
26+ echo '<head>' >> dist/index.html
27+ echo ' <title>Slaking Helm Repository</title>' >> dist/index.html
28+ echo ' <meta charset="utf-8">' >> dist/index.html
29+ echo ' <meta name="viewport" content="width=device-width, initial-scale=1">' >> dist/index.html
30+ echo ' <style>' >> dist/index.html
31+ echo ' body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 40px; }' >> dist/index.html
32+ echo ' .container { max-width: 800px; margin: 0 auto; }' >> dist/index.html
33+ echo ' h1 { color: #24292e; }' >> dist/index.html
34+ echo ' .repo-info { background: #f6f8fa; padding: 20px; border-radius: 6px; margin: 20px 0; }' >> dist/index.html
35+ echo ' .install { background: #dafbe1; padding: 20px; border-radius: 6px; margin: 20px 0; }' >> dist/index.html
36+ echo ' code { background: #f6f8fa; padding: 2px 6px; border-radius: 3px; }' >> dist/index.html
37+ echo ' pre { background: #f6f8fa; padding: 15px; border-radius: 6px; overflow-x: auto; }' >> dist/index.html
38+ echo ' </style>' >> dist/index.html
39+ echo '</head>' >> dist/index.html
40+ echo '<body>' >> dist/index.html
41+ echo ' <div class="container">' >> dist/index.html
42+ echo ' <h1>🚀 Slaking Helm Repository</h1>' >> dist/index.html
43+ echo ' <div class="repo-info">' >> dist/index.html
44+ echo ' <h2>About</h2>' >> dist/index.html
45+ echo ' <p>This is the Helm chart repository for Slaking, a Kubernetes service that monitors workloads for annotations and sends filtered logs to Slack channels.</p>' >> dist/index.html
46+ echo ' </div>' >> dist/index.html
47+ echo ' <div class="install">' >> dist/index.html
48+ echo ' <h2>Installation</h2>' >> dist/index.html
49+ echo ' <p>Add this repository to your Helm installation:</p>' >> dist/index.html
50+ echo ' <pre><code>helm repo add slaking https://REPO_OWNER.github.io/REPO_NAME' >> dist/index.html
51+ echo 'helm repo update</code></pre>' >> dist/index.html
52+ echo ' <p>Install the Slaking chart:</p>' >> dist/index.html
53+ echo ' <pre><code>helm install slaking slaking/slaking</code></pre>' >> dist/index.html
54+ echo ' </div>' >> dist/index.html
55+ echo ' <div class="repo-info">' >> dist/index.html
56+ echo ' <h2>Documentation</h2>' >> dist/index.html
57+ echo ' <p>For more information, visit the <a href="https://github.com/REPO_FULL">GitHub repository</a>.</p>' >> dist/index.html
58+ echo ' </div>' >> dist/index.html
59+ echo ' </div>' >> dist/index.html
60+ echo '</body>' >> dist/index.html
61+ echo '</html>' >> dist/index.html
62+
63+ - name : Replace placeholders
64+ run : |
65+ sed -i "s/REPO_OWNER/${{ github.repository_owner }}/g" dist/index.html
66+ sed -i "s/REPO_NAME/${{ github.event.repository.name }}/g" dist/index.html
67+ sed -i "s|REPO_FULL|${{ github.repository }}|g" dist/index.html
68+
69+ - name : Upload artifact
70+ uses : actions/upload-pages-artifact@v3
71+ with :
72+ path : ./dist
73+
74+ deploy :
75+ environment :
76+ name : github-pages
77+ url : ${{ steps.deployment.outputs.page_url }}
78+ runs-on : ubuntu-latest
79+ needs : setup
80+ steps :
81+ - name : Deploy to GitHub Pages
82+ id : deployment
83+ uses : actions/deploy-pages@v4
0 commit comments