Problem: The bundle install command was failing with exit code 4, typically caused by:
- Jekyll version incompatibility with GitHub Pages
- Missing or incorrect Gemfile configuration
- Bundler cache conflicts
Solution:
- Switched from individual Jekyll gems to the
github-pagesgem, which ensures compatibility - Updated workflow to:
- Disable bundler-cache initially to avoid conflicts
- Explicitly install bundler v2.0
- Set bundle config to use local path (
vendor/bundle) - Add retry logic (
--retry 3) for network issues
Before:
gem "jekyll", "~> 4.3"
gem "jekyll-feed", "~> 0.15"
# ... other individual gemsAfter:
gem "github-pages", group: :jekyll_plugins
gem "jekyll-feed", "~> 0.15"
# ... additional pluginsThe github-pages gem includes:
- Compatible Jekyll version
- All necessary plugins
- GitHub Pages-specific configurations
- Added explicit bundler installation
- Configured bundle to use local path (avoids permission issues)
- Added retry logic for network failures
- Proper environment variables for Jekyll build
- Updated
_config.ymlbaseurl to/solve-genomics - Removed theme override (handled by github-pages gem)
- Gemfile: Switched to
github-pagesgem - .github/workflows/pages.yml: Improved bundle install process
- _config.yml: Updated baseurl and removed theme override
The workflow should now:
- ✅ Successfully install Ruby dependencies
- ✅ Build TypeScript and TailwindCSS
- ✅ Build Jekyll site without errors
- ✅ Deploy to GitHub Pages
-
Enable GitHub Pages in repository settings:
- Go to: https://github.com/Sapana-Micro-Software/solve-genomics/settings/pages
- Select "GitHub Actions" as source
- Save
-
Monitor the workflow:
- Check Actions tab for build status
- Site will be available at: https://sapana-micro-software.github.io/solve-genomics/
If build still fails:
- Check Actions logs for specific error messages
- Verify Ruby version compatibility (currently using 3.1)
- Ensure all dependencies are listed in Gemfile
- Check that
_config.ymlis valid YAML