Skip to content

Commit 6c472f8

Browse files
Fix API documentation hosting issues to prevent 404 errors
1 parent d1687e4 commit 6c472f8

File tree

6 files changed

+85
-6
lines changed

6 files changed

+85
-6
lines changed

.github/workflows/jekyll-gh-pages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# This workflow is currently disabled and has been renamed to jekyll-gh-pages.yml.disabled
12
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
23
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
34

45
on:
56
# Runs on pushes targeting the default branch
67
push:
7-
branches: ["main"]
8+
branches: ["disabled-branch"]
89

910
# Allows you to run this workflow manually from the Actions tab
1011
workflow_dispatch:
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow is currently disabled
2+
# Sample workflow for building and deploying a Jekyll site to GitHub Pages
3+
name: Deploy Jekyll with GitHub Pages dependencies preinstalled
4+
5+
on:
6+
# Runs on pushes targeting the default branch
7+
push:
8+
branches: ["disabled-branch"]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+
concurrency:
22+
group: "pages"
23+
cancel-in-progress: false
24+
25+
jobs:
26+
# Build job
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
- name: Setup Pages
33+
uses: actions/configure-pages@v5
34+
- name: Build with Jekyll
35+
uses: actions/jekyll-build-pages@v1
36+
with:
37+
source: ./
38+
destination: ./_site
39+
- name: Upload artifact
40+
uses: actions/upload-pages-artifact@v3
41+
42+
# Deployment job
43+
deploy:
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
runs-on: ubuntu-latest
48+
needs: build
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

docs/.nojekyll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en-US" class="no-js"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="/favicon.ico"><link rel="mask-icon" href="/favicon.svg" color="#333333"><title>Documentation</title><script>var baseUrl = "/"</script><script defer="defer" src="/js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="/js/index.d2f6f6a9.js"></script><link href="/css/index.3a335429.css" rel="stylesheet"></head><body data-color-scheme="auto"><noscript><style>.noscript{font-family:"SF Pro Display","SF Pro Icons","Helvetica Neue",Helvetica,Arial,sans-serif;margin:92px auto 140px auto;text-align:center;width:980px}.noscript-title{color:#111;font-size:48px;font-weight:600;letter-spacing:-.003em;line-height:1.08365;margin:0 auto 54px auto;width:502px}@media only screen and (max-width:1068px){.noscript{margin:90px auto 120px auto;width:692px}.noscript-title{font-size:40px;letter-spacing:0;line-height:1.1;margin:0 auto 45px auto;width:420px}}@media only screen and (max-width:735px){.noscript{margin:45px auto 60px auto;width:87.5%}.noscript-title{font-size:32px;letter-spacing:.004em;line-height:1.125;margin:0 auto 35px auto;max-width:330px;width:auto}}#loading-placeholder{display:none}</style><div class="noscript"><h1 class="noscript-title">This page requires JavaScript.</h1><p>Please turn on JavaScript in your browser and refresh the page to view its content.</p></div></noscript><div id="app"></div></body></html>
1+
<!doctype html><html lang="en-US" class="no-js"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><link rel="icon" href="./favicon.ico"><link rel="mask-icon" href="./favicon.svg" color="#333333"><title>Documentation</title><script>var baseUrl = "./"</script><script defer="defer" src="./js/chunk-vendors.bdb7cbba.js"></script><script defer="defer" src="./js/index.d2f6f6a9.js"></script><link href="./css/index.3a335429.css" rel="stylesheet"></head><body data-color-scheme="auto"><noscript><style>.noscript{font-family:"SF Pro Display","SF Pro Icons","Helvetica Neue",Helvetica,Arial,sans-serif;margin:92px auto 140px auto;text-align:center;width:980px}.noscript-title{color:#111;font-size:48px;font-weight:600;letter-spacing:-.003em;line-height:1.08365;margin:0 auto 54px auto;width:502px}@media only screen and (max-width:1068px){.noscript{margin:90px auto 120px auto;width:692px}.noscript-title{font-size:40px;letter-spacing:0;line-height:1.1;margin:0 auto 45px auto;width:420px}}@media only screen and (max-width:735px){.noscript{margin:45px auto 60px auto;width:87.5%}.noscript-title{font-size:32px;letter-spacing:.004em;line-height:1.125;margin:0 auto 35px auto;max-width:330px;width:auto}}#loading-placeholder{display:none}</style><div class="noscript"><h1 class="noscript-title">This page requires JavaScript.</h1><p>Please turn on JavaScript in your browser and refresh the page to view its content.</p></div></noscript><div id="app"></div></body></html>

scripts/build-docs.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
# Script to generate API documentation
3+
4+
# Create output directory if it doesn't exist
5+
mkdir -p docs
6+
7+
# Convert OpenAPI specification to symbol graph
8+
echo "Converting OpenAPI spec to SymbolGraph..."
9+
swift run openapi-to-symbolgraph registry.openapi.yaml --output-path registry.symbolgraph.json
10+
11+
# Generate DocC documentation
12+
echo "Generating DocC documentation..."
13+
xcrun docc convert RegistryAPI.docc \
14+
--fallback-display-name "Registry API" \
15+
--fallback-bundle-identifier com.example.RegistryAPI \
16+
--fallback-bundle-version 1.0.0 \
17+
--additional-symbol-graph-dir ./ \
18+
--output-path ./docs \
19+
--hosting-base-path OpenAPI-Integration-with-DocC
20+
21+
# Make sure .nojekyll file exists
22+
touch docs/.nojekyll
23+
24+
echo "Documentation generated successfully in ./docs directory"
25+
echo "You can preview it using: ./scripts/serve-docs.sh"

scripts/serve-docs.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ fi
2626

2727
# Check if python3 is available
2828
if command -v python3 &> /dev/null; then
29-
echo "Starting server with python3 on port $PORT from docs/api directory..."
30-
python3 -m http.server $PORT --directory docs/api
29+
echo "Starting server with python3 on port $PORT from docs directory..."
30+
python3 -m http.server $PORT --directory docs
3131
# Check if python is available as a fallback
3232
elif command -v python &> /dev/null; then
3333
# Check Python version to ensure it's Python 3
3434
PYTHON_VERSION=$(python --version 2>&1)
3535
if [[ $PYTHON_VERSION == *"Python 3"* ]]; then
36-
echo "Starting server with python on port $PORT from docs/api directory..."
37-
python -m http.server $PORT --directory docs/api
36+
echo "Starting server with python on port $PORT from docs directory..."
37+
python -m http.server $PORT --directory docs
3838
else
3939
echo "Error: Python 3 is required to run the server."
4040
exit 1

0 commit comments

Comments
 (0)