Skip to content

Commit 76e4e40

Browse files
authored
Update update_docs
1 parent f240b00 commit 76e4e40

File tree

1 file changed

+38
-47
lines changed

1 file changed

+38
-47
lines changed

.ci_scripts/update_docs

Lines changed: 38 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,43 @@
11
#!/usr/bin/env bash
22

3-
# This script is to be run in a TravisCI context.
43
set -ex
54

6-
if [ -n "$GH_TOKEN" ]; then
7-
# TODO What is the purpose of this check? If we're on master, then check out master??
8-
# Make sure we are on the latest commit on `master` if we are planning to deploy the change.
9-
# if [[ "$TRAVIS_BRANCH" == "master" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then
10-
# git checkout master
11-
# fi
12-
git checkout -b new_site_content
13-
# Generate html requires a GitHub token in order to query the available feedstocks.
14-
conda env create -f ./.ci_scripts/environment.yml
15-
conda activate conda-forge-docs
16-
17-
# rebuild elm
18-
# uncomment to restore search
19-
# npm install uglify-js --global
20-
# ./elm-compile.xsh
21-
22-
# build docs into docs/; preserve old README file
23-
mv docs/README docs-README
24-
rm -rf docs/
25-
26-
cd src
27-
make html
28-
mv _build/html ../docs
29-
rm -rf _build
30-
31-
cd ..
32-
mv docs-README docs/README
33-
34-
# git diff
35-
36-
# Only commit the docs for commits on master.
37-
# GITHUB_HEAD_REF is empty on forks
38-
if [[ "$GH_REF" == "ref/heads/master" ]] && [[ "$GH_ACTOR" == "conda-forge" ]]; then
39-
git add -A :/
40-
git commit -m "Re-ran make.py. [ci skip]" || true
41-
git remote add pushable https://${GH_TOKEN}@github.com/conda-forge/conda-forge.github.io.git/ > /dev/null
42-
43-
# Update the remotes before pushing and check the status.
44-
# This should give us more info if the push will not be
45-
# a simple fast-forward push.
46-
git fetch --all 2> /dev/null
47-
git branch -u pushable/master
48-
git status
49-
git push pushable new_site_content:master 2> /dev/null
50-
fi
5+
git checkout -b new_site_content
6+
# Generate html requires a GitHub token in order to query the available feedstocks.
7+
conda env create -f ./.ci_scripts/environment.yml
8+
conda activate conda-forge-docs
9+
10+
# rebuild elm
11+
# uncomment to restore search
12+
# npm install uglify-js --global
13+
# ./elm-compile.xsh
14+
15+
# build docs into docs/; preserve old README file
16+
mv docs/README docs-README
17+
rm -rf docs/
18+
19+
cd src
20+
make html
21+
mv _build/html ../docs
22+
rm -rf _build
23+
24+
cd ..
25+
mv docs-README docs/README
26+
27+
# git diff
28+
29+
# Only commit the docs for commits on master.
30+
# GITHUB_HEAD_REF is empty on forks
31+
if [[ "$GH_REF" == "ref/heads/master" ]] && [[ "$GH_TOKEN" != "" ]]; then
32+
git add -A :/
33+
git commit -m "Re-ran make.py. [ci skip]" || true
34+
git remote add pushable https://${GH_TOKEN}@github.com/conda-forge/conda-forge.github.io.git/ > /dev/null
35+
36+
# Update the remotes before pushing and check the status.
37+
# This should give us more info if the push will not be
38+
# a simple fast-forward push.
39+
git fetch --all 2> /dev/null
40+
git branch -u pushable/master
41+
git status
42+
git push pushable new_site_content:master 2> /dev/null
5143
fi
52-

0 commit comments

Comments
 (0)