Skip to content
OpenSmartRoute
Skillv1.0.0

gh-pages-deploy

Deploy static or interactive frontend content to GitHub Pages using gh CLI. Use when the user wants to publish, share, or make accessible any HTML/CSS/JS content - including demos, prototypes, visuali

by aviz85(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from aviz85/claude-skills-library (skills/gh-pages-deploy/SKILL.md). Install upstream with npx skills add aviz85/claude-skills-library --skill gh-pages-deploy. Copyright stays with the author.

GitHub Pages Deployment

Deploy static frontend websites to GitHub Pages using the GitHub CLI.

Prerequisites

  • GitHub CLI (gh) installed and authenticated
  • Git installed
  • A frontend project (HTML, CSS, JS) ready to deploy

Deployment Workflow

1. Initialize Git Repository (if needed)

git init
git add .
git commit -m "Initial commit"

2. Create GitHub Repository

# Create public repo (required for free GitHub Pages)
gh repo create <repo-name> --public --source=. --push

3. Enable GitHub Pages

# Enable GitHub Pages from main branch root
gh api repos/{owner}/{repo}/pages -X POST -f build_type=legacy -f source='{"branch":"main","path":"/"}'

Or for docs folder:

gh api repos/{owner}/{repo}/pages -X POST -f build_type=legacy -f source='{"branch":"main","path":"/docs"}'

4. Check Deployment Status

# Get pages info
gh api repos/{owner}/{repo}/pages

# View deployment status
gh api repos/{owner}/{repo}/pages/builds/latest

5. Set Homepage URL in Repo Settings

Always do this — sets the live URL in the GitHub repo's About panel (top-right on the repo page):

OWNER=$(gh api user --jq '.login')
PAGES_URL=$(gh api repos/$OWNER/$REPO_NAME/pages --jq '.html_url')
gh api --method PATCH repos/$OWNER/$REPO_NAME --field homepage="$PAGES_URL" --jq '.homepage'

6. Get Site URL

The site will be available at: https://<username>.github.io/<repo-name>/

Auto-deploy is active: every push to main triggers a rebuild. No GitHub Actions needed for legacy build.

Quick Deploy Script

For a complete deployment in one flow:

# Variables
REPO_NAME="my-site"

# Initialize and commit
git init
git add .
git commit -m "Initial commit"

# Create repo and push
gh repo create $REPO_NAME --public --source=. --push

# Enable pages
sleep 2
OWNER=$(gh api user --jq '.login')
gh api repos/$OWNER/$REPO_NAME/pages -X POST -f build_type=legacy -f source='{"branch":"main","path":"/"}'

# Set homepage URL in repo About panel
PAGES_URL="https://$OWNER.github.io/$REPO_NAME/"
gh api --method PATCH repos/$OWNER/$REPO_NAME --field homepage="$PAGES_URL" --jq '.homepage'

echo "✓ Site live at: $PAGES_URL"

Troubleshooting

  • Pages not enabled: Ensure repo is public or you have GitHub Pro
  • 404 error: Wait 1-2 minutes for deployment, check if index.html exists at root
  • Build failed: Check GitHub Actions tab for errors

Updating the Site

After making changes:

git add .
git commit -m "Update site"
git push

GitHub Pages will automatically rebuild.

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/aviz85-claude-skills-library-gh-pages-deploy/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

aviz85-claude-skills-library-gh-pages-deploy.ocm.jsonjson
{
  "ocm": "1",
  "id": "aviz85-claude-skills-library-gh-pages-deploy",
  "kind": "skill",
  "name": "gh-pages-deploy",
  "description": "Deploy static or interactive frontend content to GitHub Pages using gh CLI. Use when the user wants to publish, share, or make accessible any HTML/CSS/JS content - including demos, prototypes, visualizations, landing pages, portfolios, documentation, interactive tools, games, or any browser-based project. Activate whenever content needs to be publicly viewable via URL, not just when \"website\" is explicitly mentioned.",
  "publisher": "aviz85",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "general"
    ],
    "tags": [
      "skill-md",
      "deployment",
      "github",
      "hosting",
      "frontend",
      "skills-sh"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Deploy static or interactive frontend content to GitHub Pages using gh CLI. Use when the user wants to publish, share, or make accessible any HTML/CSS/JS content - including demos, prototypes, visualizations, landing pages, portfolios, documentation, interactive tools, games, or any browser-based project. Activate whenever content needs to be publicly viewable via URL, not just when \"website\" is explicitly mentioned."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "skills.sh",
      "repository": "https://github.com/aviz85/claude-skills-library",
      "path": "skills/gh-pages-deploy/SKILL.md",
      "ref": "HEAD",
      "url": "https://github.com/aviz85/claude-skills-library/blob/HEAD/skills/gh-pages-deploy/SKILL.md",
      "key": "aviz85/claude-skills-library/skills/gh-pages-deploy/SKILL.md"
    }
  },
  "instructions": "# GitHub Pages Deployment\n\nDeploy static frontend websites to GitHub Pages using the GitHub CLI.\n\n## Prerequisites\n\n- GitHub CLI (`gh`) installed and authenticated\n- Git installed\n- A frontend project (HTML, CSS, JS) ready to deploy\n\n## Deployment Workflow\n\n### 1. Initialize Git Repository (if needed)\n\n```bash\ngit init\ngit add .\ngit commit -m \"Initial commit\"\n```\n\n### 2. Create GitHub Repository\n\n```bash\n# Create public repo (required for free GitHub Pages)\ngh repo create <repo-name> --public --source=. --push\n```\n\n### 3. Enable GitHub Pages\n\n```bash\n# Enable GitHub Pages from main branch root",
  "cost": {
    "context_tokens": 650
  }
}

Fetch it by URL: GET /api/v1/registry/aviz85-claude-skills-library-gh-pages-deploy/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.