From c48078abfcb4d17b671e44746597372cd1284c49 Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Tue, 27 Aug 2024 20:18:42 -0300 Subject: [PATCH] Add README.md, update Rakefile --- README.md | 21 +++++++++++++++++++++ Rakefile | 13 +++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 000000000..36b172638 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +## About + +The "production" branch provides a simple environment for +deploying the website to CloudFlare Pages. This branch also +includes the build directory that is live on production +([build/al-quran/](build/al-quran/)). + +## Example + + ## + # Clone / Pull a copy of the website + bundle exec rake source:clone + bundle exec rake source:pull + + ## + # Build the website + # git: commit build/al-quran + # git: push + # deploy: auto-deploy by CloudFlare + bundle exec rake deploy + diff --git a/Rakefile b/Rakefile index d733385de..deb8b14a7 100644 --- a/Rakefile +++ b/Rakefile @@ -1,18 +1,23 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + namespace :source do - desc "Clone" + desc "Clone the website" task :clone do # TODO end - desc "Pull updates" + desc "Pull website updates" task :pull do Dir.chdir File.join(__dir__, "source") do sh "git pull --rebase origin main" end end +end +namespace :website do desc "Build the website" - task build: %i[source:clean] do + task build: %i[website:clean] do Dir.chdir File.join(__dir__, "source") do Bundler.with_unbundled_env do sh "bundle exec rake nanoc:clean" @@ -23,7 +28,7 @@ namespace :source do end desc "Deploy the website" - task deploy: %i[source:build] do + task deploy: %i[source:pull website:build] do sh "git commit -am 'Update build/al-quran' || true" sh "git push github production" end