diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml new file mode 100644 index 0000000..a7f89a6 --- /dev/null +++ b/.github/workflows/jekyll.yml @@ -0,0 +1,60 @@ +name: Build and deploy Jekyll site to GitHub Pages + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' + bundler-cache: true + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + with: + source: ./ + destination: ./_site + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/Gemfile b/Gemfile index 6fae9b0..f950238 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,12 @@ source 'https://rubygems.org' -gem 'jekyll' -gem 'jekyll-feed' -gem 'jekyll-sitemap' \ No newline at end of file +# GitHub Pages compatible gems +gem 'github-pages', group: :jekyll_plugins +gem 'jekyll-feed', '~> 0.12' +gem 'jekyll-sitemap' + +# If you want to use GitHub Pages, uncomment the line below and comment out the jekyll gem above +# gem 'github-pages', group: :jekyll_plugins + +# For local development, you can use a newer Jekyll version +# gem 'jekyll', '~> 4.3.0' \ No newline at end of file diff --git a/Gemfile.github-pages b/Gemfile.github-pages new file mode 100644 index 0000000..e78c76e --- /dev/null +++ b/Gemfile.github-pages @@ -0,0 +1,20 @@ +source 'https://rubygems.org' + +# GitHub Pages compatible gems +gem 'github-pages', group: :jekyll_plugins +gem 'jekyll-feed', '~> 0.12' +gem 'jekyll-sitemap' + +# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem +# and associated library. +platforms :mingw, :x64_mingw, :mswin, :jruby do + gem 'tzinfo', '>= 1', '< 3' + gem 'tzinfo-data' +end + +# Performance-booster for watching directories on Windows +gem 'wdm', '~> 0.1.1', :platforms => [:mingw, :x64_mingw, :mswin] + +# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem +# do not have a Java counterpart. +gem 'http_parser.rb', '~> 0.6.0', :platforms => [:jruby] diff --git a/switch-to-github-pages.sh b/switch-to-github-pages.sh new file mode 100755 index 0000000..61bcf6f --- /dev/null +++ b/switch-to-github-pages.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Script to switch to GitHub Pages compatible setup + +echo "Switching to GitHub Pages compatible setup..." + +# Backup current Gemfile +cp Gemfile Gemfile.local-dev + +# Use GitHub Pages compatible Gemfile +cp Gemfile.github-pages Gemfile + +echo "✅ Switched to GitHub Pages compatible setup" +echo "📝 Your local development Gemfile has been backed up as Gemfile.local-dev" +echo "" +echo "To switch back to local development:" +echo " cp Gemfile.local-dev Gemfile" +echo " bundle install" +echo "" +echo "To deploy to GitHub Pages:" +echo " git add ." +echo " git commit -m 'Update for GitHub Pages'" +echo " git push origin main" diff --git a/switch-to-local-dev.sh b/switch-to-local-dev.sh new file mode 100755 index 0000000..e3fa6f9 --- /dev/null +++ b/switch-to-local-dev.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Script to switch back to local development setup + +echo "Switching to local development setup..." + +# Use local development Gemfile +cp Gemfile.local-dev Gemfile + +echo "✅ Switched to local development setup" +echo "" +echo "To install dependencies:" +echo " bundle install" +echo "" +echo "To run locally:" +echo " bundle exec jekyll serve"