does gh-pages requires travis.yml? - github

I am trying push my changes into gh-pages/index.html but it was failed,
The PR located https://github.com/bulkan/robotframework-archivelibrary/pull/20
However travis-ci documentation https://docs.travis-ci.com/user/customizing-the-build/#Building-Specific-Branches
By default, the gh-pages branch is not built unless you add it to the
whitelist.
I don't exact reason why travis-ci is started building gh-pages, do i need add .travis.yml to gh-pages or are there anythin i was missed here https://github.com/bulkan/robotframework-archivelibrary/tree/gh-pages

It looks like the build that failed was run on a different branch named doc-update, which we wouldn't block by default, as it's not named gh-pages
What we can do this by enable our setting to only run builds on branches that have a .travis.yml file on them, shown in below screen cast

Related

Travis build only fails for main repo master branch

I have a weird issue. Travis OSX builds keep failing because a Jasmine unit test doesn't pass. But, this ONLY happens for commits against the main GitHub repo's master branch. Forked repos, PR's on the main repo, etc do not have this issue. Here are a couple of scenarios:
I sync local master from upstream master and push. Travis build fails.
I make a change, literally any change such as adding a random character to readme.md, commit and push, and the build passes.
I open a PR, the PR build passes
The PR is merged to upstream master, the build fails
There are no issues when running the unit tests locally, so I can only pin it as a GitHub and/or Travis issue. Tried clearing the caches in Travis and did not help. I scrolled through the raw logs side-by-side from a failed and passing build and they were fairly identical, at least nothing I wouldn't expect to be different.
So kind of at a loss here on what to do. Any suggestions?
https://github.com/Glavin001/atom-beautify/blob/master/.travis.yml
This was not an issue specifically with the master branch.
The issue was caused by the Travis environment variable, TRAVIS_COMMIT_MESSAGE. When you merge a PR on GitHub, the default commit message has a "message" and a "description", separate by a line break. Having that line break in the TRAVIS_COMMIT_MESSAGE caused path issues with Ruby and/or Rubygems.
This was resolved by blanking out the environment variable by adding the below to our .travis.yml in the before_install step at the very beginning:
- export TRAVIS_COMMIT_MESSAGE=""

If my repo IS my Jekyll site, does gh-pages still need to be an orphan?

There are many suggestions that when you start a gh-pages branch, to start the branch as an orphan and remove the contents from git.
For example, here: http://robots.thoughtbot.com/its-for-the-orphans and on the official github: https://help.github.com/articles/creating-project-pages-manually/
However, would this apply if my master branch is my gh-pages branch? That is to say, my entire repo was created to be a Jekyll site. My assumption is that gh-pages branch and the master branch should be identical.
In the case where the repo is created solely as a Jekyll site, what is the best way to create and maintian the gh-pages branch for a project site? I've had troubles in the past keeping the master branch and gh-pages branches identical. One solution I've been suggested to delete the master branch and have only the gh-pages branch, is this considered bad or good practice and why?
I've also seen this suggestion of nesting repos: https://gist.github.com/chrisjacob/833223 However, it seems like I really do not need a master and a gh-pages, since my repo is only gh-pages.
However, I may also have a basic misunderstanding of this since I started using Jekyll a few days ago, please let me know if it is not correct that gh-pages would be the same as master branch for a Jekyll only project, and why.
Thanks!
master branch is eventually used for :
hosting a user/organisation site (http://github.com/username/username.github.io)
host your Jelyll code if you use a deploying strategy like with octopress (code in master, generated pages in gh-pages), mainly when you need to run plugins locally.
If you simply hosts a project site (http://github.com/username/projectName) that doesn't needs special plugins, you can safely delete master branch and use gh-pages as you main branch.
You can then make a new branch locally for testing purpose, then merge it in gh-pages before pushing to github.
The master branch is not special in any way other than being automatically created when you create a new repo. It can be safely ignored or even deleted if you don't need it.
You can delete it, that's what I do for the majority of my Jekyll sites as it means I don't push to the wrong branch!
In your repo settings just set gh-pages as the default branch and then you can safely delete Master.

Travis CI kick off build on new tag

I am trying to use travis for continues integration with github. I want to create a custom deploy on new tags. The problem is I can not get travis to kick of the build when I create tag.
I believe an alternative would be to create a release branch...
my travis.yml looks like this
language: node_js
node_js:
- "0.10"
# whitelist
branches:
only:
- master
after_success:
./build/update-ghpages.sh
Here's a few things:
Are you pushing your tags to github with git push --tags?
Are you pulling your tags on travis-ci with git fetch --tags?
You branch white list could also prevent tagged builds from running, as they could be blocked for not being master branch.
Are your tags based off branch master? If so then the last comment shouldn't apply, as the tagged commit should still be built from the commit on master and your deployment program will still recognize it is a tag if git fetch --tags is performed.
If none of these suggestions help you I'll be happy to take a look at your setup if you give me a link to your travis-ci build.
Safelisting also prevents tagged commits from being built. To allow tags trigger the build consider adding tags to the whitelist with regular expressions, for example /^v\d+.\d+(.\d+)?(-\S*)?$/ if you use v1.0 naming pattern
For additional information go here

Is there a way to use a pre/post commit hook in github to update gh-pages branch from master?

I have a completely static site (eg. https://github.com/robertjchristian/angular-enterprise-seed) hosted on github, where I work mostly out of the master branch. The contents of the /app/ directory are byte-for-byte what I want to host. So during development I just cd ~/projects/angular-enterprise-seed/app, and then "python -m SimpleHTTPServer". This allows me to browse the site locally at localhost:8000.
I want to host the static contents of /app on the web as well, and gh-pages is the ideal candidate. Here are my requirements:
Don't want to "just use gh-pages branch as master"
Don't want to rely on a wrapper script that keeps gh-pages in line with master changes from the client.
Don't want to build out a service to handle the webhook post, checkout from master, and check into gh-pages.
Ideally it would be a github hook that says "Post commit hook - sync gh-pages with change in master"
Any ideas?
Thanks.
After reading through a variety of different solutions for handling the sync between master and gh-pages, I ended up adopting an approached favored by JavaScript guru Sindre Sorhus and others:
Make the gh-pages branch the default one on GitHub
Delete the master branch
Use the gh-pages branch as master.
You can see this on GitHub in Sindre's screenful.js repo, or in my project, selection-menu.

How to push only specific folders from Master branch to gh-pages branch?

I'm fairly new to github and web development in general. So say I have all of my project files on my Master branch and I want to push only the files needed to make my page run on gh-pages. How would I tell it to only push certain files to the new gh-pages branch? For example, when you use gulp or grunt it makes a folder that is your rendered site for previewing your site. How would I push only the contents from that site folder to gh-pages without adding all of the other unecessary that are on the Master branch?
I've been using Jekyll recently because you can still push all of the files onto gh-pages and it still works. But I have 2 repositories for a lot of my projects. One repository has all of the source files and then the other repository has only the files I need to push a working site onto gh-pages. I want to clean up my github page so it is more organized.
Thank you.
I know this is an old question, but for the benefit of newcomers to Git branches / gh-pages that might stumble across this problem, I found the least complicated way of moving files or folders from a master branch to a gh-pages branch is to do the following.
# First switch to the gh-pages branch
git checkout gh-pages
# Next checkout the specific file you wish to add to the gh-pages branch
git checkout master -- <path/to/file/folders/on/master/branch>
# Perfom the commit
git commit -m "Updated index.html from master"
# And push
git push
Assuming the file(s) you are trying to add to the gh-pages branch exist on the master branch you shouldn't have any problems following the above steps.
If you are using nodejs and npm you can use the gh-pages package from the command line to publish to a gh-pages branch from a specific directory. The gh-pages package has a command line utility.
Installing the package creates a gh-pages command line utility. Run gh-pages --help to see a list of supported options.
Note: You mentioned using Gulp and there is an npm package called gulp-gh-pages that I use successfully to create gulp tasks to put into my deploy workflow.
I believe you're looking for git subtree merge.
The idea of the subtree merge is that you have two projects, and one of the projects maps to a subdirectory of the other one and vice versa.
When you specify a subtree merge, Git is smart enough to figure out that one is a subtree of the other and merge appropriately — it’s pretty amazing.