From b5a81a33eefb5baa3c1cd7f4bab6b5fac5e2cd9d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:43:55 +0000 Subject: [PATCH 1/3] Initial plan From 1b33b700d6535b5d0667534e0a71a5c46473874a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:47:21 +0000 Subject: [PATCH 2/3] Add GitHub Actions workflow to build and deploy static site to gh-pages branch Co-authored-by: stev4501 <34610768+stev4501@users.noreply.github.com> Agent-Logs-Url: https://github.com/stev4501/Hormone-experts/sessions/e68edaf5-2b06-4012-9591-4157c8136654 --- .github/workflows/deploy-gh-pages.yml | 73 +++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/deploy-gh-pages.yml diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml new file mode 100644 index 0000000..6800dfe --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yml @@ -0,0 +1,73 @@ +name: Deploy Static Site to GitHub Pages + +on: + push: + branches: ["main", "copilot/gh-pages-for-hormone-experts"] + workflow_dispatch: + +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build static index.html from Select-product-page.jsx + run: | + python3 - << 'PYEOF' + import re + + with open('Select-product-page.jsx', 'r') as f: + content = f.read() + + # Replace ES module import with global React reference + component_code = content.replace( + 'import { useState } from "react";', + 'const { useState } = React;' + ).replace( + 'export default function MensHealthCombined', + 'function MensHealthCombined' + ) + + html = f""" + + + + + Hormone Experts – Men's Health + + + + + + +
+ + + + """ + + import os + os.makedirs('gh-pages-dist', exist_ok=True) + with open('gh-pages-dist/index.html', 'w') as f: + f.write(html) + + print(f"Generated gh-pages-dist/index.html ({len(html)} bytes)") + PYEOF + + - name: Deploy to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./gh-pages-dist + publish_branch: gh-pages + force_orphan: true + commit_message: "Deploy Hormone Experts product page to GitHub Pages" From 66b8f087faabb83901a719b9b5ebe6da0177e569 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 21 Mar 2026 02:50:44 +0000 Subject: [PATCH 3/3] Pin CDN versions, use regex transforms, pin action to v3.9.3, deploy only from main Co-authored-by: stev4501 <34610768+stev4501@users.noreply.github.com> Agent-Logs-Url: https://github.com/stev4501/Hormone-experts/sessions/e68edaf5-2b06-4012-9591-4157c8136654 --- .github/workflows/deploy-gh-pages.yml | 72 +++-- docs/index.html | 449 ++++++++++++++++++++++++++ 2 files changed, 487 insertions(+), 34 deletions(-) create mode 100644 docs/index.html diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index 6800dfe..43ea5a2 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -2,7 +2,7 @@ name: Deploy Static Site to GitHub Pages on: push: - branches: ["main", "copilot/gh-pages-for-hormone-experts"] + branches: ["main"] workflow_dispatch: permissions: @@ -17,45 +17,49 @@ jobs: - name: Build static index.html from Select-product-page.jsx run: | python3 - << 'PYEOF' - import re + import re, os with open('Select-product-page.jsx', 'r') as f: content = f.read() - # Replace ES module import with global React reference - component_code = content.replace( - 'import { useState } from "react";', - 'const { useState } = React;' - ).replace( - 'export default function MensHealthCombined', - 'function MensHealthCombined' + # Replace ES module import with global React reference using regex + # to handle variations in whitespace or quote style + component_code = re.sub( + r'''import\s*\{\s*useState\s*\}\s*from\s*['"]react['"];?''', + 'const { useState } = React;', + content + ) + # Remove export default so MensHealthCombined is a plain function in browser scope + component_code = re.sub( + r'\bexport\s+default\s+function\s+', + 'function ', + component_code ) - html = f""" - - - - - Hormone Experts – Men's Health - - - - - - -
- - - - """ + html = """ + + + + + Hormone Experts – Men's Health + + + + + + +
+ + + +""" - import os os.makedirs('gh-pages-dist', exist_ok=True) with open('gh-pages-dist/index.html', 'w') as f: f.write(html) @@ -64,7 +68,7 @@ jobs: PYEOF - name: Deploy to gh-pages branch - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v3.9.3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./gh-pages-dist diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..2b0888f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,449 @@ + + + + + + Hormone Experts – Men's Health + + + + + + +
+ + +