diff --git a/.github/workflows/deploy-ftp-ssh.yml b/.github/workflows/deploy-ftp-ssh.yml new file mode 100644 index 0000000..c9a9db7 --- /dev/null +++ b/.github/workflows/deploy-ftp-ssh.yml @@ -0,0 +1,13 @@ +name: Deploy to web server with FTP or SSH + +on: + push: # Trigger on any push, but branch validation will filter + workflow_dispatch: # Allow manual triggering + +jobs: + deploy: + uses: electricbookworks/electric-book-deploy-workflow-ftp-ssh/.github/workflows/deploy.yml@v1.0.2 + secrets: inherit + with: + setup-command: 'bundle install' + build-command: 'bundle exec jekyll build --config="_config.yml,_configs/_config.live.yml"' \ No newline at end of file diff --git a/.github/workflows/deploy.config.json b/.github/workflows/deploy.config.json new file mode 100644 index 0000000..f1608d2 --- /dev/null +++ b/.github/workflows/deploy.config.json @@ -0,0 +1,22 @@ +{ + "ftp-ssh": { + "configs-comment": "All configs are relative to the _configs folder. ", + "configs": ["_config.live.yml"], + "builds": [ + { + "configs": [], + "dir": "" + } + ], + "staging":{ + "type": "ssh", + "web-root": "public_html", + "path": "" + }, + "live": { + "type": "ssh", + "web-root": "public_html", + "path": "" + } + } +} \ No newline at end of file diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..912ea67 --- /dev/null +++ b/.htaccess @@ -0,0 +1,7 @@ +RewriteEngine on + +RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] +RewriteRule ^(.*)$ http://%1/$1 [R=301,L] + +RewriteCond %{HTTPS} !on +RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] \ No newline at end of file diff --git a/Gemfile b/Gemfile index 1eda72f..ea527e7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,20 @@ source 'https://rubygems.org' -gem 'jekyll', '3.8.6' +gem 'jekyll', '~> 4.3' +gem 'rexml' +gem 'webrick' +gem 'kramdown-parser-gfm' + +# 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/Gemfile.lock b/Gemfile.lock index 1a85c6a..346d7f2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,61 +1,106 @@ GEM remote: https://rubygems.org/ specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) + base64 (0.3.0) + bigdecimal (3.3.1) colorator (1.1.0) - concurrent-ruby (1.1.9) + concurrent-ruby (1.3.5) + csv (3.3.5) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) + eventmachine (1.2.7) eventmachine (1.2.7-x64-mingw32) - ffi (1.15.5-x64-mingw32) + ffi (1.17.2) forwardable-extended (2.6.0) + google-protobuf (4.33.2) + bigdecimal + rake (>= 13) + google-protobuf (4.33.2-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.33.2-x86_64-linux-gnu) + bigdecimal + rake (>= 13) http_parser.rb (0.8.0) - i18n (0.9.5) + i18n (1.14.7) concurrent-ruby (~> 1.0) - jekyll (3.8.6) + jekyll (4.4.1) addressable (~> 2.4) + base64 (~> 0.2) colorator (~> 1.0) + csv (~> 3.0) em-websocket (~> 0.5) - i18n (~> 0.7) - jekyll-sass-converter (~> 1.0) + i18n (~> 1.0) + jekyll-sass-converter (>= 2.0, < 4.0) jekyll-watch (~> 2.0) - kramdown (~> 1.14) + json (~> 2.6) + kramdown (~> 2.3, >= 2.3.1) + kramdown-parser-gfm (~> 1.0) liquid (~> 4.0) - mercenary (~> 0.3.3) + mercenary (~> 0.3, >= 0.3.6) pathutil (~> 0.9) - rouge (>= 1.7, < 4) + rouge (>= 3.0, < 5.0) safe_yaml (~> 1.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) + terminal-table (>= 1.8, < 4.0) + webrick (~> 1.7) + jekyll-sass-converter (3.1.0) + sass-embedded (~> 1.75) jekyll-watch (2.2.1) listen (~> 3.0) - kramdown (1.17.0) - liquid (4.0.3) - listen (3.7.1) + json (2.17.1) + kramdown (2.5.1) + rexml (>= 3.3.9) + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.4) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) + mercenary (0.4.0) pathutil (0.16.2) forwardable-extended (~> 2.6) - public_suffix (4.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) + public_suffix (7.0.0) + rake (13.3.1) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) ffi (~> 1.0) - rouge (3.27.0) + rexml (3.4.4) + rouge (4.6.1) safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) + sass-embedded (1.96.0) + google-protobuf (~> 4.31) + rake (>= 13) + sass-embedded (1.96.0-arm64-darwin) + google-protobuf (~> 4.31) + sass-embedded (1.96.0-x86_64-linux-gnu) + google-protobuf (~> 4.31) + terminal-table (3.0.2) + unicode-display_width (>= 1.1.1, < 3) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + tzinfo-data (1.2025.2) + tzinfo (>= 1.0.0) + unicode-display_width (2.6.0) + wdm (0.1.1) + webrick (1.9.2) PLATFORMS + arm64-darwin-23 x64-mingw32 + x86_64-linux DEPENDENCIES - jekyll (= 3.8.6) + http_parser.rb (~> 0.6.0) + jekyll (~> 4.3) + kramdown-parser-gfm + rexml + tzinfo (>= 1, < 3) + tzinfo-data + wdm (~> 0.1.1) + webrick BUNDLED WITH 2.2.19 diff --git a/_config.yml b/_config.yml index 83929a0..ebb4783 100644 --- a/_config.yml +++ b/_config.yml @@ -73,6 +73,7 @@ win-web.bat, win-epub.bat, linux-pdf.sh, mac-pdf.sh, +vendor ] # Can be useful to stop Jekyll overwriting files in _site.