Skip to content

Latest commit

 

History

History
105 lines (82 loc) · 2.59 KB

deploy-to-github-pages.adoc

File metadata and controls

105 lines (82 loc) · 2.59 KB

Deploy website to GitHub Pages

Commit and push any outstanding changes

$ git commit . -m "Enhancements"
$ git push origin master

Create the publish branch, gh-pages

$ git checkout --orphan gh-pages
$ rm -rf *
$ rm -rf .awestruct* .sass-* .gitignore .gitmodules
$ git rm --cached *
$ echo "GitHub Pages placeholder" > index.html
$ git add index.html .nojekyll
$ git commit -m "Seed publish branch for GitHub Pages"

Push the publish branch

$ git push origin gh-pages
$ git checkout master
Note
By pushing the gh-pages branch, you also activated GitHub Pages to publish your website.
View your website
http://%USERNAME%.github.io/writeadapt-%USERNAME%

Setup the Awestruct GitHub Pages deployer

Append to _config/site.yml
profiles:
  development:
    deploy: nil #(1)
  production:
    base_url: http://%USERNAME%.github.io/writeadapt-%USERNAME%
    ctx_path: /writeadapt-%USERNAME%
    asciidoctor:
      :attributes:
        base_url: http://%USERNAME%.github.io/writeadapt-%USERNAME%
        ctx_path: /writeadapt-%USERNAME%
        imagesdir: http://%USERNAME%.github.io/writeadapt-%USERNAME%/images #(2)
    deploy:
      host: github_pages
      branch: gh-pages
  1. nil deploy config forces development as default profile

  2. imagesdir must be absolute to work around Atom feed bug

Important
Replace %USERNAME% with your GitHub username.

Commit deployer configuration

$ git commit _config/site.yml -m "Add profile for GitHub Pages deployment"
$ git push origin master

Deploy to GitHub Pages

$ rake clean deploy
View your website again
http://%USERNAME%.github.io/writeadapt-%USERNAME%
Important
Your Awestruct-based website is now live, and available worldwide!