Class: Bard::DeployStrategy::GithubPages
- Inherits:
-
Bard::DeployStrategy
- Object
- Bard::DeployStrategy
- Bard::DeployStrategy::GithubPages
- Defined in:
- lib/bard/deploy_strategy/github_pages.rb
Instance Attribute Summary
Attributes inherited from Bard::DeployStrategy
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(target, url = nil, **options) ⇒ GithubPages
constructor
A new instance of GithubPages.
Methods inherited from Bard::DeployStrategy
[], inherited, #run, #run!, #system!
Constructor Details
#initialize(target, url = nil, **options) ⇒ GithubPages
Returns a new instance of GithubPages.
9 10 11 12 13 14 15 16 |
# File 'lib/bard/deploy_strategy/github_pages.rb', line 9 def initialize(target, url = nil, **) super(target) @url = url = # Auto-configure ping URL if provided target.ping(url) if url end |
Instance Method Details
#deploy ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/bard/deploy_strategy/github_pages.rb', line 18 def deploy @sha = Git.sha_of(Git.current_branch) @build_dir = "tmp/github-build-#{@sha}" @branch = "gh-pages" @domain = extract_domain puts "Starting deployment to GitHub Pages..." build_site tree_sha = create_tree_from_build new_commit = create_commit(tree_sha) commit_and_push(new_commit) end |