Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 13, 2025

🎯 Solution Overview

This PR implements a simpler publishing strategy for GitHub Pages deployment as requested in issue #8.

📋 Issue Reference

Fixes #8 - Attempt to use simpler strategy to publish files

🔧 Implementation Details

Previous Complex Approach (39 lines):

  • Clone entire repository to access gh-pages branch
  • Navigate between multiple directories
  • Remove origin, add new origin
  • Fetch and checkout gh-pages branch
  • Delete all existing files
  • Copy built files and commit

New Simplified Approach (32 lines):

  • Build project locally with npm run export
  • Navigate directly to out/ directory
  • Initialize fresh git repository with git init
  • Add all files and commit
  • Add remote and force push to gh-pages branch

✨ Key Improvements

  1. Reduced Complexity: Eliminates the need to clone the entire repository
  2. Fewer Dependencies: No need to manage existing gh-pages branch state
  3. Cleaner Logic: Direct git operations in the output directory
  4. Performance: Faster execution without repository cloning
  5. Maintainability: Easier to understand and debug

🔍 Technical Changes

The new script follows the Stack Overflow recommended approach for converting a directory into a git working directory:

  1. git init - Initialize repository in output directory
  2. git add --all - Stage all built files
  3. git commit - Create deployment commit
  4. git remote add origin - Connect to GitHub repository
  5. git push -f origin gh-pages - Force push to gh-pages branch

🚀 Benefits

  • Simpler maintenance: Less moving parts to break
  • Better error handling: Clearer failure points
  • Reduced resource usage: No need to clone large repositories
  • Standard approach: Uses well-established git patterns

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #8
@konard konard self-assigned this Sep 13, 2025
- Remove complex repository cloning approach
- Initialize git directly in the 'out' directory after build
- Use Stack Overflow recommended approach for simpler deployment
- Reduces complexity from ~30 lines to ~20 lines
- Eliminates need to clone entire repository just to access gh-pages branch

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Attempt to use simpler strategy to publish files Simplify publish.sh strategy using direct git init approach Sep 13, 2025
@konard konard marked this pull request as ready for review September 13, 2025 18:37
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempt to use simpler strategy to publish files

2 participants