-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install deps in github actions instead of script
- Loading branch information
Showing
2 changed files
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,16 +13,6 @@ def rmtree_if_exists(dir): | |
pass | ||
|
||
def install_dependencies(): | ||
branch = os.environ['GITHUB_REF'] | ||
if branch != 'refs/heads/master': | ||
print('Branch: ' + branch) | ||
exit(0) # Ignore non-master branches | ||
check_call('curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key ' + | ||
'| sudo apt-key add -', shell=True) | ||
check_call('echo "deb https://deb.nodesource.com/node_0.10 precise main" ' + | ||
'| sudo tee /etc/apt/sources.list.d/nodesource.list', shell=True) | ||
check_call(['sudo', 'apt-get', 'update']) | ||
check_call(['sudo', 'apt-get', 'install', 'python-virtualenv']) | ||
deb_file = 'doxygen_1.8.6-2_amd64.deb' | ||
urllib.urlretrieve('http://mirrors.kernel.org/ubuntu/pool/main/d/doxygen/' + | ||
deb_file, deb_file) | ||
|
@@ -38,22 +28,29 @@ def install_dependencies(): | |
build.create_build_env() | ||
html_dir = build.build_docs() | ||
repo = 'fmtlib.github.io' | ||
branch = os.environ['GITHUB_REF'] | ||
if is_ci and branch != 'refs/heads/master': | ||
print('Branch: ' + branch) | ||
exit(0) # Ignore non-master branches | ||
if is_ci and 'KEY' not in os.environ: | ||
# Don't update the repo if building in CI from an account that doesn't have | ||
# push access. | ||
print('Skipping update of ' + repo) | ||
exit(0) | ||
|
||
# Clone the fmtlib.github.io repo. | ||
rmtree_if_exists(repo) | ||
git_url = 'https://github.com/' if is_ci else '[email protected]:' | ||
check_call(['git', 'clone', git_url + 'fmtlib/{}.git'.format(repo)]) | ||
|
||
# Copy docs to the repo. | ||
target_dir = os.path.join(repo, 'dev') | ||
rmtree_if_exists(target_dir) | ||
shutil.copytree(html_dir, target_dir, ignore=shutil.ignore_patterns('.*')) | ||
if is_ci: | ||
check_call(['git', 'config', '--global', 'user.name', 'fmtbot']) | ||
check_call(['git', 'config', '--global', 'user.email', '[email protected]']) | ||
|
||
# Push docs to GitHub pages. | ||
check_call(['git', 'add', '--all'], cwd=repo) | ||
if call(['git', 'diff-index', '--quiet', 'HEAD'], cwd=repo): | ||
|