Web Deploy GitHub Pages

👤 thomeksolutions 📦 v1.0.0 ⭐ 4.4 ⬇️ 8.2K 下载
🔒 IT运维与安全 免费

📖 技能介绍


name: web-deploy-github description: Create and deploy single-page static websites to GitHub Pages with autonomous workflow. Use when building portfolio sites, CV pages, landing pages, or any static web project that needs GitHub Pages deployment. Handles complete workflow from project initialization to live deployment with GitHub Actions automation.


Web Deploy GitHub Pages

Overview

This skill enables autonomous creation and deployment of static websites to GitHub Pages. It follows a complete workflow from project structure initialization through automatic deployment via GitHub Actions, optimized for single-page applications, portfolios, and landing pages.

Core Workflow

1. Project Initialization

Create the project structure:

bash scripts/init_project.sh <project-name>

This creates:

project-name/
├── index.html
├── styles.css
├── script.js
├── README.md
└── .github/
    └── workflows/
        └── deploy.yml

2. Development

Build the website following these principles: - Single-page first: Optimize for one-page layouts unless multiple pages explicitly required - Autonomous generation: Generate complete, production-ready code without placeholders - Modern design: Use modern CSS (flexbox, grid), responsive design, clean aesthetics - No dependencies: Pure HTML/CSS/JS when possible, CDN links if frameworks needed

Use templates from assets/templates/ as starting points: - base-html/ - Minimal HTML5 boilerplate - portfolio/ - Portfolio/CV template with sections - landing/ - Landing page with hero and CTA

3. GitHub Repository Setup

bash scripts/deploy_github_pages.sh <project-name> <github-username>

This script: 1. Initializes git repository 2. Creates GitHub repository via GitHub CLI 3. Configures GitHub Pages settings 4. Pushes initial commit 5. Triggers first deployment

4. Deployment

GitHub Actions automatically deploys on push to main branch. The workflow: - Checks out code - Deploys to gh-pages branch - Makes site live at https://<username>.github.io/<project-name>/

Architecture Guidelines

HTML Structure

  • Semantic HTML5 elements
  • Meta tags for SEO and social sharing
  • Responsive viewport configuration
  • Favicon and icons

CSS Design

  • Mobile-first responsive design
  • CSS variables for theming
  • Flexbox/Grid for layouts
  • Smooth transitions and animations
  • Dark mode support when appropriate

JavaScript

  • Vanilla JS preferred
  • Progressive enhancement
  • Event delegation
  • No console errors

Performance

  • Optimized images
  • Minified assets for production
  • Lazy loading where appropriate

    小葱技能7w4.net有更新,你可以访问看下。

  • Fast initial load time

Quick Examples

Example 1: Portfolio CV Site

User request: "Crée-moi un site portfolio CV"

Action: 1. Run init_project.sh portfolio-cv 2. Use assets/templates/portfolio/ as base 3. Generate complete HTML with sections: Hero, About, Skills, Projects, Contact 4. Deploy with deploy_github_pages.sh portfolio-cv username

Example 2: Landing Page

User request: "Fais-moi une landing page pour mon app"

Action: 1. Run init_project.sh app-landing 2. Use assets/templates/landing/ as base 3. Generate with Hero, Features, Pricing, CTA 4. Deploy with deploy_github_pages.sh app-landing username

Troubleshooting

GitHub Pages Not Deploying

  • Check repository Settings → Pages → Source is set to gh-pages branch
  • Verify GitHub Actions workflow ran successfully
  • Check DNS propagation (can take 5-10 minutes)

Permission Errors

  • Ensure gh CLI is authenticated: gh auth status
  • Check repository permissions on GitHub

Build Failures

  • Review Actions logs in repository
  • Verify .github/workflows/deploy.yml syntax
  • Check file paths and references

Resources

scripts/

  • init_project.sh - Initialize project structure
  • deploy_github_pages.sh - Deploy to GitHub Pages

references/

  • workflow.md - Detailed workflow documentation
  • design-patterns.md - Design best practices

assets/

  • templates/base-html/ - Minimal HTML5 boilerplate
  • templates/portfolio/ - Portfolio/CV template
  • templates/landing/ - Landing page template
  • .github/workflows/deploy.yml - GitHub Actions workflow template

🤖 AI 评测

这个Skill能帮你快速创建和部署静态网站到GitHub Pages,功能基本完整,文档说明也比较详细。不过实际使用中可能遇到问题:预置的模板样式不能直接使用,部署配置容易出错,需要手动调整才能正常工作。如果你是新手,可能需要花时间排查配置问题。总体来说有一定实用性,但稳定性和易用性还有提升空间。

📊 多维度评分

适应性4.2
规范性4.5
有效性4.6
可靠性4.2
可信度4.4

📁 包含文件 (15 个)

📄 SKILL.md 4.2 KB
📄 _meta.json 136 B
📄 assets/templates/base-html/index.html 414 B
📄 assets/templates/base-html/script.js 28 B
📄 assets/templates/base-html/styles.css 373 B
📄 assets/templates/landing/index.html 7.8 KB
📄 assets/templates/landing/script.js 1.8 KB
📄 assets/templates/landing/styles.css 6.7 KB
📄 assets/templates/portfolio/index.html 5.9 KB
📄 assets/templates/portfolio/script.js 1.5 KB
📄 assets/templates/portfolio/styles.css 5.6 KB
📄 references/design-patterns.md 8.8 KB
📄 references/workflow.md 4.4 KB
📄 scripts/deploy_github_pages.sh 1.8 KB
📄 scripts/init_project.sh 2.6 KB