Deployment Guide
This guide will walk you through the process of deploying the BrowserBee documentation to GitHub Pages.
Prerequisites#
Before you begin, make sure you have:
- A GitHub account
- Git installed on your local machine
- Node.js and npm installed
- Access to the BrowserBee repository
Setting Up GitHub Pages#
GitHub Pages is a static site hosting service that takes HTML, CSS, and JavaScript files directly from a repository on GitHub and publishes a website.
Configure docusaurus.config.js#
The docusaurus.config.js file has already been configured for GitHub Pages deployment with the following settings:
module.exports = { // ... url: 'https://parsaghaffari.github.io', baseUrl: '/browserbee/', organizationName: 'parsaghaffari', // GitHub username projectName: 'browserbee', // GitHub repository name // ...};If you're deploying to a different GitHub account, you'll need to update these values accordingly.
Deployment Process#
Manual Deployment#
Build the documentation site
cd docsnpm run buildDeploy to GitHub Pages
npm run deployThis command will:
- Build the website
- Create a
gh-pagesbranch if it doesn't exist - Push the built files to the
gh-pagesbranch
Configure GitHub Repository Settings
- Go to your GitHub repository
- Navigate to Settings > Pages
- Ensure the source is set to the
gh-pagesbranch - Your site will be published at
https://[username].github.io/browserbee/
Automated Deployment with GitHub Actions#
You can also set up GitHub Actions to automatically deploy your documentation whenever changes are pushed to the main branch.
- Create a GitHub Actions workflow file at
.github/workflows/documentation.yml:
name: Deploy Documentation
on: push: branches: [main] paths: ['docs/**']
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 16 cache: npm cache-dependency-path: docs/package-lock.json
- name: Install dependencies run: cd docs && npm ci
- name: Build website run: cd docs && npm run build
- name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./docs/build user_name: github-actions[bot] user_email: github-actions[bot]@users.noreply.github.com- Push this file to your repository
- GitHub Actions will automatically deploy your documentation when changes are pushed to the main branch
Customizing the Documentation#
Changing the Theme#
You can customize the look and feel of your documentation by editing the docs/src/css/custom.css file.
Adding Custom Pages#
To add custom pages:
- Create a new markdown file in the
docs/docsdirectory - Add front matter with a sidebar position:
---sidebar_position: 6--- - Add your content using Markdown
Adding Images#
To add images to your documentation:
- Place your images in the
docs/static/imgdirectory - Reference them in your markdown files:

Troubleshooting#
Deployment Fails#
If deployment fails, check:
- Your GitHub repository settings
- The
docusaurus.config.jsconfiguration - GitHub Actions logs (if using automated deployment)
Broken Links#
If you have broken links in your documentation:
- Run
npm run buildlocally to check for broken links - Fix any broken links reported in the console
- Redeploy the documentation
Updating the Documentation#
To update the documentation:
- Make your changes to the markdown files
- Build and test locally:
cd docsnpm run start - Deploy the changes using one of the methods above