Skip to content

Commit c58e2e7

Browse files
committed
deploy /doc as github site
1 parent 173c278 commit c58e2e7

File tree

4 files changed

+160
-0
lines changed

4 files changed

+160
-0
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Deploy Docs to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # Or your default branch name
7+
paths:
8+
- 'doc/**' # Only trigger when files in doc directory change
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# Allow one concurrent deployment
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: true
19+
20+
jobs:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v3
32+
33+
- name: Upload artifact
34+
uses: actions/upload-pages-artifact@v1
35+
with:
36+
path: './doc'
37+
38+
- name: Deploy to GitHub Pages
39+
id: deployment
40+
uses: actions/deploy-pages@v2

doc/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

doc/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Documentation Site
2+
3+
This directory contains documentation that is automatically deployed to GitHub Pages.
4+
5+
## How It Works
6+
7+
1. The content in this `doc` directory is automatically deployed to GitHub Pages whenever changes are pushed to the main branch.
8+
2. The deployment is handled by GitHub Actions using the workflow defined in `.github/workflows/deploy-docs.yml`.
9+
3. The site is accessible at `https://[username].github.io/CS_basics/` after deployment.
10+
11+
## Local Development
12+
13+
To test the documentation site locally:
14+
15+
1. Navigate to the `doc` directory
16+
2. Serve the content with a simple HTTP server:
17+
```
18+
python -m http.server
19+
```
20+
3. Open your browser to `http://localhost:8000` to view the site
21+
22+
## Adding New Documentation
23+
24+
1. Add your markdown or HTML files to the appropriate subdirectory
25+
2. Update the `index.html` file to include links to your new documentation
26+
3. Commit and push your changes to the main branch to trigger deployment
27+
28+
## File Types Supported
29+
30+
- Markdown (.md) files (viewed as rendered HTML on GitHub Pages)
31+
- HTML files
32+
- PDF files
33+
- Images and other assets

doc/index.html

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>CS Basics Documentation</title>
7+
<style>
8+
body {
9+
font-family: Arial, sans-serif;
10+
line-height: 1.6;
11+
max-width: 1000px;
12+
margin: 0 auto;
13+
padding: 20px;
14+
}
15+
h1 {
16+
color: #333;
17+
border-bottom: 2px solid #eee;
18+
padding-bottom: 10px;
19+
}
20+
ul {
21+
list-style-type: none;
22+
padding: 0;
23+
}
24+
li {
25+
margin-bottom: 8px;
26+
}
27+
a {
28+
color: #0366d6;
29+
text-decoration: none;
30+
}
31+
a:hover {
32+
text-decoration: underline;
33+
}
34+
.category {
35+
margin-bottom: 30px;
36+
}
37+
</style>
38+
</head>
39+
<body>
40+
<h1>CS Basics Documentation</h1>
41+
42+
<div class="category">
43+
<h2>Resources</h2>
44+
<ul>
45+
<li><a href="Resource.md">General Resources</a></li>
46+
<li><a href="ref.md">References</a></li>
47+
<li><a href="tech_blog.txt">Tech Blogs</a></li>
48+
</ul>
49+
</div>
50+
51+
<div class="category">
52+
<h2>LeetCode</h2>
53+
<ul>
54+
<li><a href="lc_category.md">LeetCode by Category</a></li>
55+
<li><a href="leetcode_classics_collection.md">LeetCode Classics Collection</a></li>
56+
<li><a href="lc_sql_resource.md">SQL Resources</a></li>
57+
<li><a href="from_0_to_FLAG_leetcode.md">From 0 to FAANG LeetCode Guide</a></li>
58+
</ul>
59+
</div>
60+
61+
<div class="category">
62+
<h2>Notes & Cheatsheets</h2>
63+
<ul>
64+
<li><a href="bit_manipulation.md">Bit Manipulation</a></li>
65+
<li><a href="hash_map_collision.md">Hash Map Collision</a></li>
66+
<li><a href="cheatsheet/">Cheatsheets</a></li>
67+
</ul>
68+
</div>
69+
70+
<div class="category">
71+
<h2>Directories</h2>
72+
<ul>
73+
<li><a href="note/">Notes</a></li>
74+
<li><a href="faq/">FAQs</a></li>
75+
<li><a href="important/">Important</a></li>
76+
<li><a href="distributed_system/">Distributed Systems</a></li>
77+
<li><a href="cs_foundation/">CS Foundation</a></li>
78+
<li><a href="course/">Courses</a></li>
79+
</ul>
80+
</div>
81+
82+
<footer>
83+
<p>&copy; 2023 CS Basics. All rights reserved.</p>
84+
</footer>
85+
</body>
86+
</html>

0 commit comments

Comments
 (0)