Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFrancis N
10,376 PointsI am currently having issues deploying github pages with gulp
Hello all,
I went through the Gulp Basics, Using "gulp-useref" and Deploy App to Github Pages with Gulp tutorials and when I finished, my page on github pages pulls a 404 error. Unlike the tutorial videos, my page has a CNAME. I used my personal website as testing grounds to learn Gulp. At this point, I do not know how to debug the issues because everything looks like it should work. I did read someone on Github that if you are using <username>.github.io , that I cannot publish site from different locations other than master branch. Currently I have everything built out and deploy to src. Can someone help explain what is it that I am doing wrong? And also, what is the difference between gulp deploy and git push origin master?
Here is my github: https://github.com/francisngo/francisngo.github.io
Much appreciated. :)
2 Answers
Seth Kroger
56,413 PointsYes, the username.github.io repository is the one exception to publishing to the gh-pages branch. You need to have gulp-gh-pages deploy to the master branch. (the README docs show you options you can pass to the plugin such as changing the deployment branch.) Which in turn requires you use a different branch than master for your source.
Jesus Mendoza
23,289 PointsI have everything on my main folder on github and everything works great.
https://github.com/Jesusz0r/Jesusz0r.github.io check it out as a reference if you want to
Francis N
10,376 Pointsthanks for sharing your page but it doesn't look like you used gulp to deploy your page which is my issue.
Francis N
10,376 PointsFrancis N
10,376 Pointshow do i make gulp-gh-pages deploy to master branch? sorry i dont understand.
Seth Kroger
56,413 PointsSeth Kroger
56,413 PointsFirst create a new branch for you main source:
git checkout -b dev
(and push it to GitHub). This way you are usingdev
for your edits instead ofmaster
. Then instead ofghPages();
you can useghPages({ branch: "master" });
Francis N
10,376 PointsFrancis N
10,376 Pointsthank you. your explanation helped it. the documentation is hard for me to understand but you helped clarify it and now my page works. :)