Skip to content

Commit f952bcd

Browse files
authored
docs: add Docusaurus documentation site with GitHub Actions deployment (#36)
- Add comprehensive documentation site in docs/ folder (21 pages) - Getting Started: Installation, Quick Start, Why SGuard - Core Concepts: Guard methods, Callbacks, Custom Exceptions, Expression Caching - Guides: Null/Empty checks, Comparisons, Collections, Strings, Real-world examples - Advanced: Performance, Best Practices - API Reference: ThrowIf, Is, Callbacks - Community: Contributing, Code of Conduct, Changelog - Add GitHub Actions workflow for automatic deployment to gh-pages - Update README.md with documentation links - Remove broken coverage badge from README - Configure Docusaurus with SGuard branding and metadata - Add .gitignore entries for Docusaurus build artifacts Documentation will be available at: https://selcukgural.github.io/SGuard/
1 parent 9c135db commit f952bcd

45 files changed

Lines changed: 23118 additions & 205 deletions

Some content is hidden

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

‎.github/workflows/deploy-docs.yml‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
- '.github/workflows/deploy-docs.yml'
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
deploy:
17+
name: Deploy to GitHub Pages
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: 'npm'
28+
cache-dependency-path: docs/package-lock.json
29+
30+
- name: Install dependencies
31+
working-directory: docs
32+
run: npm ci
33+
34+
- name: Build website
35+
working-directory: docs
36+
run: npm run build
37+
38+
- name: Deploy to GitHub Pages
39+
uses: peaceiris/actions-gh-pages@v4
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
publish_dir: ./docs/build
43+
user_name: 'github-actions[bot]'
44+
user_email: 'github-actions[bot]@users.noreply.github.com'
45+
commit_message: 'Deploy documentation'

‎.gitignore‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,4 +553,8 @@ $RECYCLE.BIN/
553553

554554

555555
# Windows shortcuts
556-
*.lnk
556+
*.lnk
557+
# Docusaurus
558+
docs/.docusaurus/
559+
docs/build/
560+
docs/.cache-loader/

‎docs/.gitignore‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

‎docs/README.md‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
4+
5+
## Installation
6+
7+
```bash
8+
yarn
9+
```
10+
11+
## Local Development
12+
13+
```bash
14+
yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
## Build
20+
21+
```bash
22+
yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
## Deployment
28+
29+
Using SSH:
30+
31+
```bash
32+
USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```bash
38+
GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

0 commit comments

Comments
 (0)