This guide will help you deploy the AAS API documentation to GitHub Pages.
main (or your current branch)/docsGitHub will automatically build and deploy your site. This takes 1-2 minutes.
Youβll see a message like:
Your site is published at https://[username].github.io/aas-specs-api/
Click on the URL provided or visit:
https://[username].github.io/aas-specs-api/
Your documentation site includes:
index.html) - Browse all API specificationsswagger-ui.html) - Interactive API testingredoc.html) - Beautiful documentation viewerdocs/
βββ index.html # Landing page (REQUIRED)
βββ swagger-ui.html # Swagger UI viewer
βββ redoc.html # Redoc viewer
βββ 404.html # Custom 404 page
βββ README.md # Documentation
βββ _config.yml # GitHub Pages config
βββ .nojekyll # Disable Jekyll processing
Edit the CSS in index.html, swagger-ui.html, or redoc.html:
/* Current gradient */
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
/* Change to your colors */
background: linear-gradient(135deg, #YOUR_COLOR_1 0%, #YOUR_COLOR_2 100%);
docs/assets/images/logo.png<div class="custom-header">
<img src="assets/images/logo.png" alt="Logo" height="40">
<h1>Your Title</h1>
</div>
Edit the footer section in index.html:
<div class="footer">
<p>© 2025 Your Organization</p>
<p>Your custom links here</p>
</div>
To use a custom domain like docs.yourdomain.com:
CNAME to the docs/ folder with your domain:
docs.yourdomain.com
[username].github.ioβ οΈ IMPORTANT: You MUST serve from the repository root (not from inside docs/) for the OpenAPI specifications to work correctly.
The YAML files contain $ref references like:
$ref: '../Part2-API-Schemas/openapi.yaml#/components/...'
These references need access to folders outside of docs/. When you serve from the repository root, these paths resolve correctly.
# Make sure you're in the repository root (not in docs/)
python3 -m http.server 8000
# Visit: http://localhost:8000/docs/
# Node.js
npx http-server -p 8000
# Visit: http://localhost:8000/docs/
# PHP
php -S localhost:8000
# Visit: http://localhost:8000/docs/
Use the provided helper script (already in repository root):
./start-docs-server.sh
This automatically starts from the correct location.
The docs site automatically references YAML files from parent directories. When you:
To add a new API spec to the landing page:
docs/index.html<div class="api-grid"> section<div class="api-card" data-search="your api keywords">
<h3>Your API Name</h3>
<p class="description">Description of your API</p>
<div class="specs">
<span class="spec-badge">V3.2</span>
</div>
<div class="actions">
<a href="swagger-ui.html?url=../YourFolder/spec.yaml" class="btn btn-primary">Swagger UI</a>
<a href="redoc.html?url=../YourFolder/spec.yaml" class="btn btn-secondary">Redoc</a>
</div>
</div>
swagger-ui.html and redoc.html:<option value="../YourFolder/spec.yaml">Your API Name</option>
main branch, /docs folder)docs/ folder)The url parameter should be relative to the docs/ folder:
β
Correct: ?url=../Part1-MetaModel-Schemas/openapi.yaml
β Wrong: ?url=/Part1-MetaModel-Schemas/openapi.yaml
To track visitors, add Google Analytics:
<head> of each HTML file:<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-XXXXXXXXXX');
</script>
The site is fully responsive and works on:
Licensed under CC BY 4.0 - Industrial Digital Twin Association (IDTA)