Skip to content

Krisg963/docs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

AI GitHub Pages generator (example)

What this does

  • The workflow (.github/workflows/ai-generate.yml) runs the Node script (scripts/generate-index.js).
  • The script calls OpenAI to generate a single-file HTML page and writes it to docs/index.html.
  • The workflow then uses peter-evans/create-pull-request to open a PR (branch: ai/auto-index) with the changes so you can review and merge.

Setup

  1. Add these files to your repo (paths are as shown).

  2. Add a repository secret named OPENAI_API_KEY with your OpenAI API key:

    • Repo → Settings → Secrets and variables → Actions → New repository secret
    • Name: OPENAI_API_KEY
    • Value: sk-...
  3. (Optional) Edit .github/workflows/ai-generate.yml to change schedule or TARGET_PATH.

  4. Trigger the workflow manually (Actions → AI Generate Pages → Run workflow) or wait for the scheduled run.

  5. Review and merge the created PR when ready.

  6. If you plan to publish via GitHub Pages from the docs folder:

    • Settings → Pages → Source: Branch main / folder /docs

Notes and safety

  • The Action opens a PR rather than pushing directly, so you can review AI output before merging.
  • Keep your OpenAI key secret. GITHUB_TOKEN is provided automatically in Actions and is sufficient for creating PRs.
  • You can customize the prompt inside scripts/generate-index.js to tailor the page.

About

Online Documentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors