Documentation Deployment¶
Overview¶
The portfolio documentation is deployed to two platforms for redundancy and accessibility:
- Azure Static Web App (Primary) - Production deployment
- GitHub Pages (Secondary) - Backup and development preview
Deployment Targets¶
1. Azure Static Web App (Primary)¶
URL: https://docs.portfolio.onedna.nl (custom domain)
Features:
- Custom domain support
- SSL/TLS certificates
- Staging environments for PRs
- Azure CDN integration
- Production-grade hosting
Workflow: .github/workflows/deploy-docs.yml
Triggers:
- Push to
mainbranch (docs changes) - Pull requests (creates preview environment)
- Manual workflow dispatch
Requirements:
- Azure Static Web App resource
AZURE_STATIC_WEB_APPS_API_TOKENsecret in GitHub
2. GitHub Pages (Secondary)¶
URL: https://svenrelijveld1995.github.io/portfolio/
Features:
- Free hosting
- Automatic SSL
- Fast global CDN
- No configuration required
- Backup deployment
Workflow: .github/workflows/deploy-docs-github-pages.yml
Triggers:
- Push to
mainbranch (docs changes) - Manual workflow dispatch
Requirements:
- GitHub Pages enabled in repository settings
pages: writepermission
Deployment Architecture¶
docs.portfolio.onedna.nl] GitHub[GitHub Pages
github.io/portfolio] end Docs --> Push MkDocs --> Push Push --> Build Build --> Azure Build --> GitHub style Azure fill:#e91e63 style GitHub fill:#333
Setup Instructions¶
Azure Static Web App Deployment¶
1. Create Azure Resources¶
# Deploy infrastructure
az deployment sub create \
--location westeurope \
--template-file infra/main.bicep \
--parameters infra/parameters.dev.json
2. Get Deployment Token¶
# Get the deployment token
az staticwebapp secrets list \
--name onedna-dev-portfolio-westeurope-swa-abc123 \
--query "properties.apiKey" -o tsv
3. Add GitHub Secret¶
- Go to repository Settings → Secrets and variables → Actions
- Click New repository secret
- Name:
AZURE_STATIC_WEB_APPS_API_TOKEN - Value: Paste the deployment token
- Click Add secret
4. Trigger Deployment¶
GitHub Pages Deployment¶
1. Enable GitHub Pages¶
- Go to repository Settings → Pages
- Source: GitHub Actions
- Save
2. Trigger Deployment¶
The workflow runs automatically on push to main. No additional configuration needed!
Workflow Comparison¶
| Feature | Azure Static Web App | GitHub Pages |
|---|---|---|
| Custom Domain | ✅ Yes | ❌ No (subdomain only) |
| SSL Certificate | ✅ Automatic | ✅ Automatic |
| PR Previews | ✅ Yes | ❌ No |
| Cost | Free tier available | ✅ Free |
| CDN | ✅ Azure CDN | ✅ GitHub CDN |
| Build Time | ~2-3 minutes | ~1-2 minutes |
| Deployment | Requires token | Automatic |
Monitoring Deployments¶
Check Workflow Status¶
- Go to Actions tab in GitHub
- View recent workflow runs
- Click on a run to see details
Azure Static Web App¶
# Check deployment status
az staticwebapp show \
--name onedna-dev-portfolio-westeurope-swa-abc123 \
--query "properties.defaultHostname"
GitHub Pages¶
Visit: https://svenrelijveld1995.github.io/portfolio/
Troubleshooting¶
Azure Deployment Fails¶
Issue: AZURE_STATIC_WEB_APPS_API_TOKEN not found
Solution:
- Verify secret exists in GitHub repository settings
- Check secret name matches exactly
- Regenerate token if expired
Issue: Build fails
Solution:
- Check workflow logs for errors
- Verify MkDocs dependencies are correct
- Test build locally:
mkdocs build --strict
GitHub Pages Deployment Fails¶
Issue: Pages not enabled
Solution:
- Go to Settings → Pages
- Set source to "GitHub Actions"
- Re-run workflow
Issue: 404 errors
Solution:
- Wait 5-10 minutes for DNS propagation
- Clear browser cache
- Check workflow completed successfully
Manual Deployment¶
Build Locally¶
Deploy to Azure (Manual)¶
# Using Azure CLI
az staticwebapp upload \
--name onedna-dev-portfolio-westeurope-swa-abc123 \
--source ./site
Deploy to GitHub Pages (Manual)¶
Best Practices¶
1. Test Locally First¶
Always test documentation changes locally before pushing:
2. Use Strict Mode¶
Build with --strict to catch errors:
3. Check Links¶
Verify all internal links work before deploying.
4. Monitor Both Deployments¶
Check both Azure and GitHub Pages after deployment to ensure consistency.
5. Use PR Previews¶
For Azure Static Web App, create PRs to get preview environments before merging.
URLs Summary¶
| Environment | Platform | URL |
|---|---|---|
| Production | Azure Static Web App | https://docs.portfolio.onedna.nl |
| Backup | GitHub Pages | https://svenrelijveld1995.github.io/portfolio/ |
| Local | Development | http://127.0.0.1:8001 |
| PR Preview | Azure (staging) | https://<pr-id>.<app-name>.azurestaticapps.net |