Skip to content

Commit a6eba5d

Browse files
Fix: Updated GitHub Pages workflow to match expected samples path structure
1 parent 5f38a07 commit a6eba5d

File tree

1 file changed

+14
-43
lines changed

1 file changed

+14
-43
lines changed

.github/workflows/pages.yml

Lines changed: 14 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ jobs:
3535
# Copy documentation files
3636
cp -r docs/* public/
3737
38-
# Copy sample files and make them accessible
39-
cp -r DocsExample public/
40-
cp api.yaml public/
41-
cp -r API.docc public/
38+
# Copy sample files into the samples directory
39+
mkdir -p public/samples
40+
cp -r DocsExample public/samples/
41+
cp api.yaml public/samples/
42+
cp -r API.docc public/samples/
4243
4344
# Create README with instructions and note about source
44-
cat > public/README.md << 'EOF'
45+
cat > public/samples/README.md << 'EOF'
4546
# The DocsExample directory within the repository (ayushshrivastv/OpenAPI-integration-with-DocC/DocsExample) is the source for this example.
4647
4748
## Building and Viewing Documentation Locally
@@ -64,44 +65,14 @@ jobs:
6465
4. Open your browser to http://localhost:8000
6566
EOF
6667
67-
# Create a simple index page if one doesn't exist
68-
if [ ! -f public/index.html ]; then
69-
cat > public/index.html << 'EOF'
70-
<!DOCTYPE html>
71-
<html lang="en">
72-
<head>
73-
<meta charset="UTF-8">
74-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
75-
<title>OpenAPI Integration with DocC</title>
76-
<style>
77-
body { font-family: -apple-system, sans-serif; line-height: 1.6; max-width: 800px; margin: 0 auto; padding: 20px; }
78-
h1, h2 { color: #0066cc; }
79-
.card { background: #f5f5f7; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
80-
a { color: #0066cc; text-decoration: none; }
81-
a:hover { text-decoration: underline; }
82-
</style>
83-
</head>
84-
<body>
85-
<h1>OpenAPI Integration with DocC</h1>
86-
<p>Tools and examples for integrating OpenAPI specifications with Apple's DocC documentation system.</p>
87-
88-
<div class="card">
89-
<h2>Sample Files</h2>
90-
<p>The DocsExample directory within the repository (ayushshrivastv/OpenAPI-integration-with-DocC/DocsExample) is the source for this example.</p>
91-
<ul>
92-
<li><a href="./DocsExample/index.html">View Example Documentation</a></li>
93-
<li><a href="./api.yaml">OpenAPI Specification (api.yaml)</a></li>
94-
<li><a href="./API.docc">DocC Documentation Catalog (API.docc)</a></li>
95-
<li><a href="./README.md">Build Instructions</a></li>
96-
</ul>
97-
</div>
98-
</body>
99-
</html>
100-
EOF
101-
else
102-
# If there's an existing index.html, add a note about the location of examples
103-
sed -i 's/<\/body>/<div style="margin-top: 20px; padding: 10px; background: #f0f0f0; border-radius: 5px;"><p>The DocsExample directory within the repository (ayushshrivastv\/OpenAPI-integration-with-DocC\/DocsExample) is the source for this example.<\/p><p>Sample files are available: <a href="\/DocsExample">DocsExample<\/a>, <a href="\/api.yaml">api.yaml<\/a>, <a href="\/API.docc">API.docc<\/a>, <a href="\/README.md">README.md<\/a><\/p><\/div><\/body>/g' public/index.html || true
104-
fi
68+
# Copy the existing index.html as is, since it already has the correct paths
69+
cp index.html public/
70+
71+
# Copy other necessary files
72+
cp favicon.ico public/ || true
73+
cp favicon.svg public/ || true
74+
cp .nojekyll public/ || true
75+
cp 404.html public/ || true
10576
10677
- name: Upload artifact
10778
uses: actions/upload-pages-artifact@v3

0 commit comments

Comments
 (0)