Deployment Guide
This guide will walk you through the process of deploying the BrowserBee documentation to GitHub Pages.
#
PrerequisitesBefore 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 PagesGitHub 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.jsThe 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 DeploymentBuild the documentation site
cd docsnpm run build
Deploy to GitHub Pages
npm run deploy
This command will:
- Build the website
- Create a
gh-pages
branch if it doesn't exist - Push the built files to the
gh-pages
branch
Configure GitHub Repository Settings
- Go to your GitHub repository
- Navigate to Settings > Pages
- Ensure the source is set to the
gh-pages
branch - Your site will be published at
https://[username].github.io/browserbee/
#
Automated Deployment with GitHub ActionsYou 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 ThemeYou can customize the look and feel of your documentation by editing the docs/src/css/custom.css
file.
#
Adding Custom PagesTo add custom pages:
- Create a new markdown file in the
docs/docs
directory - Add front matter with a sidebar position:
---sidebar_position: 6---
- Add your content using Markdown
#
Adding ImagesTo add images to your documentation:
- Place your images in the
docs/static/img
directory - Reference them in your markdown files:

#
Troubleshooting#
Deployment FailsIf deployment fails, check:
- Your GitHub repository settings
- The
docusaurus.config.js
configuration - GitHub Actions logs (if using automated deployment)
#
Broken LinksIf you have broken links in your documentation:
- Run
npm run build
locally to check for broken links - Fix any broken links reported in the console
- Redeploy the documentation
#
Updating the DocumentationTo 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