Skip to content

Commit dc68fae

Browse files
authored
Merge pull request #1179 from conda-forge/beckermr-patch-1
BUG add env vars
2 parents 18f2a28 + 3e72342 commit dc68fae

File tree

2 files changed

+40
-47
lines changed

2 files changed

+40
-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 [[ "$GITHUB_REF" == "ref/heads/master" ]] && [[ "$GITHUB_HEAD_REF" == "" ]]; 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-

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: deploy
22

33
on:
44
push: null
5+
pull_request: null
56

67
jobs:
78
tests:
@@ -35,3 +36,4 @@ jobs:
3536
source ./.ci_scripts/update_docs
3637
env:
3738
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
GH_REF: ${{ github.ref }}

0 commit comments

Comments
 (0)