name: Automated Main Deploy Action on: push: branches: [ master ] jobs: build-and-deploy-docs: runs-on: ubuntu-latest steps: - name: Checkout repo uses: actions/checkout@v3 with: submodules: 'true' - name: Prepare documentation structure run: | # Create docs structure mkdir -p docs-output/api mkdir -p docs-output/doxygen - name: Extract API documentation run: | # Copy the entire API specification directory if [ -d "docs/api" ]; then cp -r docs/api/* docs-output/api/ fi # Copy and patch the Swagger UI HTML file if [ -f "IDHANServer/src/pages/apidocs.html" ]; then # Patch the file to use the correct GitHub Pages path sed "s|'/api/index.yaml'|'/IDHAN/api/index.yaml'|g" IDHANServer/src/pages/apidocs.html > docs-output/api/index.html fi # Copy any other API-related static files (CSS, JS, images) if [ -d "IDHANServer/src/pages" ]; then find IDHANServer/src/pages -name "*.css" -o -name "*.js" -o -name "*.png" -o -name "*.jpg" -o -name "*.ico" | while read file; do cp "$file" docs-output/api/ done fi - name: (Doxygen) Generate HTML uses: mattnotmitt/doxygen-action@v1.1.0 with: doxyfile-path: "./Doxyfile" working-directory: '.' - name: Organize documentation run: | # Copy Doxygen output cp -r docs/out/html/* docs-output/doxygen/ # Create main index page that links to both documentation types cat > docs-output/index.html << 'EOF' IDHAN Documentation

IDHAN Documentation

EOF - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: "./docs-output"