Skip to content

Commit 25261b7

Browse files
committed
chore: workflow updated for releasing docs to github pages
Signed-off-by: rohansen856 <rohansen856@gmail.com>
1 parent abad42d commit 25261b7

2 files changed

Lines changed: 111 additions & 0 deletions

File tree

.github/workflows/github-pages.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Deploy Documentation to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
jobs:
20+
build:
21+
name: Build Documentation
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: 🦀 Set up Rust
28+
uses: actions-rs/toolchain@v1
29+
with:
30+
toolchain: stable
31+
override: true
32+
33+
- name: Install dependencies
34+
run: sudo apt-get update && sudo apt-get install -y pkg-config libssl-dev
35+
36+
- name: Cache Cargo
37+
uses: actions/cache@v4
38+
with:
39+
path: |
40+
~/.cargo/registry
41+
~/.cargo/git
42+
target
43+
key: ${{ runner.os }}-cargo-pages-${{ hashFiles('**/Cargo.lock') }}
44+
45+
- name: 📦 Build project
46+
run: cargo build --release
47+
48+
- name: 📚 Generate documentation
49+
run: |
50+
# Set environment variables to prevent browser opening
51+
export GIT_EDITOR_NO_BROWSER=1
52+
export NO_BROWSER=1
53+
54+
# Create docs directory
55+
mkdir -p docs-site
56+
57+
# Generate the documentation HTML
58+
cargo run --release -- --docs
59+
60+
# Copy the generated HTML to docs-site directory
61+
cp /tmp/git-editor-docs.html docs-site/index.html
62+
63+
# Create a simple robots.txt for better SEO
64+
echo -e "User-agent: *\nAllow: /" > docs-site/robots.txt
65+
66+
# Create a .nojekyll file to bypass Jekyll processing
67+
touch docs-site/.nojekyll
68+
69+
- name: Setup Pages
70+
uses: actions/configure-pages@v4
71+
72+
- name: Upload artifact
73+
uses: actions/upload-pages-artifact@v3
74+
with:
75+
path: './docs-site'
76+
77+
deploy:
78+
name: Deploy to GitHub Pages
79+
environment:
80+
name: github-pages
81+
url: ${{ steps.deployment.outputs.page_url }}
82+
runs-on: ubuntu-latest
83+
needs: build
84+
# Only deploy on pushes to main/master, not on PRs
85+
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
86+
steps:
87+
- name: Deploy to GitHub Pages
88+
id: deployment
89+
uses: actions/deploy-pages@v4

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,28 @@ cargo build --release
3838
# The binary will be available at target/release/git-editor
3939
```
4040

41+
## Documentation
42+
43+
📚 **Comprehensive documentation is available online:** [rohansen856.github.io/git-editor](https://rohansen856.github.io/git-editor)
44+
45+
The online documentation includes:
46+
- Complete command reference with examples
47+
- Technical implementation details
48+
- Architecture overview and development guidelines
49+
- Interactive copy-to-clipboard code examples
50+
- Troubleshooting guide and FAQ
51+
- Advanced usage patterns and best practices
52+
53+
### Quick Access to Documentation
54+
55+
You can also access the documentation directly from the command line:
56+
57+
```bash
58+
git-editor --docs
59+
```
60+
61+
This command will generate and open the comprehensive documentation in your default browser.
62+
4163
## Usage
4264

4365
Git Editor supports five main modes of operation:

0 commit comments

Comments
 (0)