Loading...
Loading...
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.
npx skill4agent add aviz85/claude-skills-library gh-pages-deployghgit init
git add .
git commit -m "Initial commit"# Create public repo (required for free GitHub Pages)
gh repo create <repo-name> --public --source=. --push# Enable GitHub Pages from main branch root
gh api repos/{owner}/{repo}/pages -X POST -f build_type=legacy -f source='{"branch":"main","path":"/"}'gh api repos/{owner}/{repo}/pages -X POST -f build_type=legacy -f source='{"branch":"main","path":"/docs"}'# Get pages info
gh api repos/{owner}/{repo}/pages
# View deployment status
gh api repos/{owner}/{repo}/pages/builds/latesthttps://<username>.github.io/<repo-name>/# 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
# Wait for push to complete, then 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":"/"}'
# Get the URL
echo "Site will be at: https://$OWNER.github.io/$REPO_NAME/"git add .
git commit -m "Update site"
git push