mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-24 12:40:38 +00:00
Install deps in github actions instead of script
This commit is contained in:
parent
8f2131cf2d
commit
701ed6c874
2
.github/workflows/doc.yml
vendored
2
.github/workflows/doc.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
|
||||
- name: Create Build Environment
|
||||
run: |
|
||||
sudo apt install doxygen
|
||||
sudo apt install doxygen python-virtualenv
|
||||
sudo npm install -g less clean-css
|
||||
cmake -E make_directory ${{runner.workspace}}/build
|
||||
|
||||
|
@ -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,15 +28,21 @@ import build
|
||||
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 'git@github.com:'
|
||||
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)
|
||||
@ -54,6 +50,7 @@ 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', 'viz@fmt.dev'])
|
||||
|
||||
# Push docs to GitHub pages.
|
||||
check_call(['git', 'add', '--all'], cwd=repo)
|
||||
if call(['git', 'diff-index', '--quiet', 'HEAD'], cwd=repo):
|
||||
|
Loading…
x
Reference in New Issue
Block a user