Deploying my first Middleman site - Don't see "activate :deploy" in my config.rb file

Hey everyone,

  1. I got my middleman site to work perfectly on the local server
  2. I have all my files pushed to my github.io
  3. Having some trouble deploying to my github user page

I’ve been browsing some online tutorials about how to deploy. One tutorial said to “uncomment the following in your config.rb and set the remote”

# github deploy
 activate :deploy do |deploy|
   deploy.method = :git
   deploy.build_before = true
   deploy.branch   = "master"
   deploy.remote   = "git@github.com:username/username.github.io.git"
end

I don’t see any like " activate :deploy do |deploy|" in my config.rb file. I’ve also tried adding the line of code below to my config.rb file and still no luck

  activate :deploy do |deploy|
    deploy.method = :git
    deploy.branch = 'master'
  end

Thanks!

It looks like you’re using the middleman-deploy extension. The activate :deploy do |deploy| is not already in your config.rb file you’ll need to copy and paste the following into the config.rb. One trick, you need not have the remote value you be git@github.com:username/username.github.io.git. You can use the alias name by running on the command line git remote -v to display all your remote paths and their corresponding alias names.

# github deploy
 activate :deploy do |deploy|
   deploy.method = :git
   deploy.build_before = true
   deploy.branch   = "master"
   deploy.remote   = "git@github.com:username/username.github.io.git"
end

Assuming your repo is https://github.com/johnlin1214/Johnlin1214.github.io you’ll want to rename your master branch to another name say source.

The middleman files to build your site are in your master branch and for personal github pages, github is looking in the master branch for the output of the build to serve out.

It’s a little confusing but github projects can use gh-pages branches and personal sites have to use master. Perhaps you’ll find Github’s personal pages documentation a better explanation.