Add README.md, update Rakefile

This commit is contained in:
0x1eef 2024-08-27 20:18:42 -03:00
parent fda5f3b747
commit c48078abfc
2 changed files with 30 additions and 4 deletions

21
README.md Normal file
View file

@ -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

View file

@ -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