This guide provides step-by-step instructions for deploying the SophiaHackLab documentation site to GitHub Pages.
- Git repository pushed to GitHub:
https://github.com/SophiaHackLab/docusaurus - GitHub account with write access to the repository
- All files committed to the
mainbranch
- Go to your repository on GitHub: https://github.com/SophiaHackLab/docusaurus
- Click on Settings tab
- In the left sidebar, click Pages
- Under Build and deployment:
- Source: Select GitHub Actions
- This enables the automated deployment workflow
# Ensure you're on the main branch
git checkout main
# Add all files
git add .
# Commit with a descriptive message
git commit -m "Initial Docusaurus setup with CI/CD"
# Push to GitHub
git push origin main-
Go to the Actions tab in your repository
-
You should see two workflows running:
- Deploy to GitHub Pages - Builds and deploys the site
- E2E Tests - Runs automated tests
-
Click on each workflow to see the progress
-
Wait for both to complete (usually 2-5 minutes)
Once the deploy workflow completes successfully:
- Access the site: https://sophiahacklab.github.io/docusaurus/
- Verify:
- Homepage loads correctly
- Navigation works
- Sidebar shows all projects
- All project pages are accessible
Triggers:
- Automatic: Push to
mainbranch - Manual: Workflow dispatch button in Actions tab
What it does:
- Checks out code
- Sets up Node.js 20
- Installs dependencies
- Builds Docusaurus (with GitHub Pages base URL)
- Uploads build artifact
- Deploys to GitHub Pages
Status Badge:
[](https://github.com/SophiaHackLab/docusaurus/actions/workflows/deploy.yml)Triggers:
- Push to
mainbranch - Pull requests to
mainbranch - Manual: Workflow dispatch button
What it does:
- Checks out code
- Sets up Node.js 20 and Playwright
- Installs dependencies
- Builds and serves Docusaurus locally
- Runs 69 tests across 3 browsers (207 total test executions)
- Generates JUnit XML and HTML reports
- Uploads test artifacts (available for 30 days)
Status Badge:
[](https://github.com/SophiaHackLab/docusaurus/actions/workflows/test.yml)Always test locally before pushing:
# Run full test suite (build + serve + test + report)
npm run test:local
# Or run tests individually
npm run build # Build site
npm run serve & # Serve in background
npm run test:e2e # Run tests
npm run test:report # View HTML reportProblem: Deploy workflow shows errors
Solutions:
- Check workflow logs in Actions tab
- Verify all files are committed
- Ensure
docusaurus.config.tshas correct settings - Check Node.js version in workflow matches local
Problem: Test workflow shows failures
Solutions:
- Download test artifacts from Actions tab
- Review HTML report for specific errors
- Run tests locally:
npm run test:local - Check screenshots in test-results folder
- Fix failing tests and push again
Problem: GitHub Pages URL shows 404
Solutions:
- Verify GitHub Pages is enabled in Settings → Pages
- Check deploy workflow completed successfully
- Wait 2-3 minutes for DNS propagation
- Clear browser cache
- Check repository visibility (should be public)
Problem: Assets not loading, 404 on internal links
Solutions:
- Verify
docusaurus.config.tshas correctbaseUrl: '/docusaurus/' - Verify environment detection:
GITHUB_ACTIONSenvironment variable - Rebuild and redeploy
If you need to deploy manually without GitHub Actions:
# Set your GitHub username
export GIT_USER=<your-github-username>
# Deploy (will build and push to gh-pages branch)
npm run deployOr with SSH:
USE_SSH=true npm run deployAfter successful deployment, verify:
- Homepage loads at https://sophiahacklab.github.io/docusaurus/
- All navigation links work
- Sidebar shows all 4 projects
- Project pages are accessible:
- ROV
- Triviak Real
- Triviak Mini
- Fête de la Science
- CONTRIBUTING and TODO pages for each project
- Contributing guide is accessible in sidebar
- Test reports page is accessible
- Blog section works (3 SHL articles)
- Search functionality works (if enabled)
- Dark/light mode toggle works
- Mobile responsive design works
To update the site after initial deployment:
# Make your changes to markdown files or code
# Test locally
npm run test:local
# Commit and push
git add .
git commit -m "Update: description of changes"
git push origin main
# GitHub Actions will automatically rebuild and deploy- Go to Actions tab
- Click on a test workflow run
- Scroll to bottom to see artifacts
- Download:
test-results-junit- JUnit XML for CI integrationtest-results-html- Interactive HTML reporttest-screenshots- Screenshots (if tests failed)
- Test artifacts are kept for 30 days
- Download important reports before expiration
- Historical test results are in workflow run history
The site uses environment-based configuration:
| Environment | Detection | Base URL | Site URL |
|---|---|---|---|
| Local | Default | / |
http://localhost:3000 |
| GitHub Pages | GITHUB_ACTIONS=true |
/docusaurus/ |
https://sophiahacklab.github.io |
No manual configuration needed - automatically detected!
If you encounter issues:
- Check README.md for general documentation
- Review Test Reports for testing info
- Contact SophiaHackLab: crew@shl.contact
- Live Site: https://sophiahacklab.github.io/docusaurus/
- Repository: https://github.com/SophiaHackLab/docusaurus
- Actions: https://github.com/SophiaHackLab/docusaurus/actions
- Docusaurus Docs: https://docusaurus.io/docs
- Playwright Docs: https://playwright.dev/
- GitHub Pages: https://docs.github.com/en/pages