Skip to content

Commit 7b5f789

Browse files
derrickburnsclaude
andcommitted
fix(ci): Separate Scaladoc generation from Jekyll site deployment
- Scaladoc workflow now commits to repo instead of deploying directly - Jekyll GitHub Pages builds the entire site including API docs - Fixes issue where redirect was overwriting the Diátaxis documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f481413 commit 7b5f789

File tree

1 file changed

+21
-50
lines changed

1 file changed

+21
-50
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,25 @@ name: Generate API Documentation
33
on:
44
push:
55
branches: [master]
6+
paths:
7+
- 'src/**'
8+
- 'build.sbt'
9+
- 'project/**'
610
workflow_dispatch:
711

812
permissions:
9-
contents: read
10-
pages: write
11-
id-token: write
12-
13-
concurrency:
14-
group: "pages"
15-
cancel-in-progress: false
13+
contents: write
1614

1715
jobs:
18-
# This single job now builds AND deploys
19-
deploy:
16+
generate-docs:
2017
runs-on: ubuntu-latest
21-
name: Generate and Deploy API Docs
22-
23-
# This 'environment' block is the main fix for your error.
24-
# It tells GitHub Actions that this job is intended to deploy to Pages.
25-
environment:
26-
name: github-pages
27-
url: ${{ steps.deployment.outputs.page_url }}
18+
name: Generate Scaladoc
2819

2920
steps:
3021
- name: Checkout code
3122
uses: actions/checkout@v4
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
3225

3326
- name: Set up JDK 17
3427
uses: actions/setup-java@v4
@@ -42,41 +35,19 @@ jobs:
4235
- name: Generate Unidoc
4336
run: sbt ++2.13.14 unidoc
4437

45-
# The 'unidoc' command generates files directly to 'docs/api'.
46-
# No need to move files since build.sbt already configures the target
4738
- name: Verify documentation files
4839
run: |
4940
ls -la docs/api/
50-
echo "Documentation generated successfully"
51-
52-
- name: Create index redirect
53-
run: |
54-
cat > docs/index.html <<'EOF'
55-
<!DOCTYPE html>
56-
<html lang="en">
57-
<head>
58-
<meta charset="UTF-8">
59-
<meta http-equiv="refresh" content="0; url=api/index.html">
60-
<title>Redirecting to API Documentation</title>
61-
</head>
62-
<body>
63-
<p>Redirecting to <a href="api/index.html">API Documentation</a>...</p>
64-
</body>
65-
</html>
66-
EOF
67-
68-
# This is no longer needed in the latest versions of the deploy-pages action
69-
# - name: Setup Pages
70-
# uses: actions/configure-pages@v4
71-
72-
- name: Upload artifact
73-
uses: actions/upload-pages-artifact@v3
74-
with:
75-
# Upload the entire 'docs' directory which now contains
76-
# both the redirect and the 'api' subdirectory
77-
path: 'docs'
78-
79-
- name: Deploy to GitHub Pages
80-
id: deployment
81-
uses: actions/deploy-pages@v4
41+
echo "Scaladoc generated successfully in docs/api/"
8242
43+
- name: Commit updated API docs
44+
run: |
45+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
46+
git config --local user.name "github-actions[bot]"
47+
git add docs/api/
48+
if git diff --staged --quiet; then
49+
echo "No changes to API docs"
50+
else
51+
git commit -m "docs: Update Scaladoc API reference [skip ci]"
52+
git push
53+
fi

0 commit comments

Comments
 (0)