def setup_GitHub_push(deploy_repo, *, auth_type='<STR_LIT>',<EOL>full_key_path='<STR_LIT>', require_master=None,<EOL>branch_whitelist=None, deploy_branch='<STR_LIT>',<EOL>env_name='<STR_LIT>', build_tags=False):
<EOL>TRAVIS_TAG = os.environ.get("<STR_LIT>", "<STR_LIT>")<EOL>if branch_whitelist is None:<EOL><INDENT>branch_whitelist={'<STR_LIT>'}<EOL><DEDENT>if require_master is not None:<EOL><INDENT>import warnings<EOL>warnings.warn("<STR_LIT>",<EOL>DeprecationWarning,<EOL>stacklevel=<NUM_LIT:2>)<EOL>branch_whitelist.add('<STR_LIT>')<EOL><DEDENT>if auth_type not in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>TRAVIS_BRANCH = os.environ.get("<STR_LIT>", "<STR_LIT>")<EOL>TRAVIS_PULL_REQUEST = os.environ.get("<STR_LIT>", "<STR_LIT>")<EOL>TRAVIS_REPO_SLUG = os.environ["<STR_LIT>"]<EOL>REPO_URL = '<STR_LIT>'<EOL>r = requests.get(REPO_URL.format(slug=TRAVIS_REPO_SLUG))<EOL>fork = r.json().get('<STR_LIT>', False)<EOL>canpush = determine_push_rights(<EOL>branch_whitelist=branch_whitelist,<EOL>TRAVIS_BRANCH=TRAVIS_BRANCH,<EOL>TRAVIS_PULL_REQUEST=TRAVIS_PULL_REQUEST,<EOL>fork=fork,<EOL>TRAVIS_TAG=TRAVIS_TAG,<EOL>build_tags=build_tags)<EOL>print("<STR_LIT>")<EOL>set_git_user_email()<EOL>remotes = subprocess.check_output(['<STR_LIT>', '<STR_LIT>']).decode('<STR_LIT:utf-8>').split('<STR_LIT:\n>')<EOL>if '<STR_LIT>' in remotes:<EOL><INDENT>print("<STR_LIT>")<EOL>run(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>print("<STR_LIT>")<EOL>if canpush:<EOL><INDENT>if auth_type == '<STR_LIT>':<EOL><INDENT>token = get_token()<EOL>run(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>'.format(token=token.decode('<STR_LIT:utf-8>'),<EOL>deploy_repo=deploy_repo)])<EOL><DEDENT>else:<EOL><INDENT>keypath, key_ext = full_key_path.rsplit('<STR_LIT:.>', <NUM_LIT:1>)<EOL>key_ext = '<STR_LIT:.>' + key_ext<EOL>try:<EOL><INDENT>setup_deploy_key(keypath=keypath, key_ext=key_ext, env_name=env_name)<EOL><DEDENT>except RuntimeError:<EOL><INDENT>if r.status_code == <NUM_LIT>:<EOL><INDENT>print(yellow("<STR_LIT>"), file=sys.stderr)<EOL><DEDENT>raise<EOL><DEDENT>run(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>'.format(deploy_repo=deploy_repo)])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL>run(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>'.format(deploy_repo=deploy_repo)])<EOL><DEDENT>print("<STR_LIT>")<EOL>run(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL>return canpush<EOL>
Setup the remote to push to GitHub (to be run on Travis).

``auth_type`` should be either ``'deploy_key'`` or ``'token'``.

For ``auth_type='token'``, this sets up the remote with the token and
checks out the gh-pages branch. The token to push to GitHub is assumed to be in the ``GH_TOKEN`` environment
variable.

For ``auth_type='deploy_key'``, this sets up the remote with ssh access.