Skip to content

Commit ed03f0c

Browse files
committed
Simplify generate-site workflow to manual trigger only
Start with working workflow_dispatch trigger, can add automatic triggers later once we verify it works.
1 parent a87ad2c commit ed03f0c

File tree

1 file changed

+16
-23
lines changed

1 file changed

+16
-23
lines changed

.github/workflows/generate-site.yml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Generate GitHub Pages Site
22

33
on:
4-
push:
5-
branches: [ main ]
6-
paths:
7-
- 'docs/site-prompt.md'
8-
- 'src/spotify_mcp/fastmcp_server.py'
9-
- 'README.md'
10-
- '.github/workflows/generate-site.yml'
114
workflow_dispatch:
5+
inputs:
6+
reason:
7+
description: 'Reason for regeneration'
8+
required: false
9+
default: 'Manual trigger'
1210

1311
jobs:
1412
generate:
@@ -20,31 +18,26 @@ jobs:
2018
- name: Checkout code
2119
uses: actions/checkout@v4
2220

23-
- name: Read site prompt
24-
id: prompt
25-
run: |
26-
echo "content<<EOF" >> $GITHUB_OUTPUT
27-
cat docs/site-prompt.md >> $GITHUB_OUTPUT
28-
echo "EOF" >> $GITHUB_OUTPUT
29-
3021
- name: Generate site with Claude API
3122
env:
3223
ANTHROPIC_API_KEY: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
3324
run: |
34-
# Build the prompt
35-
cat > full_prompt.txt <<'EOF'
25+
# Build the full prompt
26+
cat > full_prompt.txt <<'PROMPTEOF'
3627
You are a web developer creating a GitHub Pages site.
3728

3829
Here are the requirements:
3930

40-
EOF
31+
PROMPTEOF
32+
4133
cat docs/site-prompt.md >> full_prompt.txt
42-
cat >> full_prompt.txt <<'EOF'
34+
35+
cat >> full_prompt.txt <<'PROMPTEOF'
4336

4437
Please generate a complete, production-ready index.html file following all requirements. Output ONLY the HTML code, no explanations or markdown code blocks.
45-
EOF
38+
PROMPTEOF
4639

47-
# Build JSON request
40+
# Build JSON request using jq
4841
jq -n \
4942
--arg model "claude-sonnet-4-20250514" \
5043
--rawfile prompt full_prompt.txt \
@@ -71,13 +64,13 @@ EOF
7164

7265
# Verify file has content
7366
if [ ! -s docs/index.html.new ]; then
74-
echo "Error: Generated HTML is empty"
67+
echo "Error: Generated HTML is empty"
7568
echo "$RESPONSE" | jq '.'
7669
exit 1
7770
fi
7871

7972
mv docs/index.html.new docs/index.html
80-
echo "Generated docs/index.html ($(wc -l < docs/index.html) lines)"
73+
echo "Generated docs/index.html ($(wc -l < docs/index.html) lines)"
8174

8275
- name: Commit and push if changed
8376
run: |
@@ -93,5 +86,5 @@ EOF
9386
9487
Generated by Claude API from docs/site-prompt.md"
9588
git push
96-
echo "Pushed updated site"
89+
echo "Pushed updated site"
9790
fi

0 commit comments

Comments
 (0)