Skip to content

Commit

Permalink
Simplify setup by creating branches later
Browse files Browse the repository at this point in the history
merges manubot/rootstock#314

* Simplify setup by creating branches later
For a new manuscript, the first deploy event won't be able to fetch
gh-pages and output because they were not pushed during setup.
However, the deploy script now ignores the error on fetch and
continues with the deployment, creating those branches at the first
deployment. All subsequent deployments work as they did previously.

* SETUP: Update with how to workaround GITHUB_TOKEN not
triggering Pages builds.
  • Loading branch information
dhimmel authored Feb 18, 2020
1 parent cd8ce12 commit c25f8b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
23 changes: 10 additions & 13 deletions SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,15 @@ REPO=rootstock
**Execute the remaining commands verbatim.**
They do not need to be edited (if the setup works as intended).

Next you must clone `manubot/rootstock` and configure its branches and remotes:
Next you must clone `manubot/rootstock` and reconfigure the remote repositories:

```sh
# Clone manubot/rootstock
git clone https://github.com/manubot/rootstock.git $REPO
git clone --single-branch https://github.com/manubot/rootstock.git $REPO
cd $REPO

# Configure remotes and branches
# Configure remotes
git remote add rootstock https://github.com/manubot/rootstock.git
git checkout --orphan gh-pages
git rm -r --force .
git commit --allow-empty \
--message "Initialize empty branch" \
--message "[ci skip]"
git checkout -b output
git checkout master

# Option A: Set origin URL using its web address
git remote set-url origin https://github.com/$OWNER/$REPO.git
Expand All @@ -76,8 +69,6 @@ Next, push your cloned manuscript:

```sh
git push --set-upstream origin master
git push --set-upstream origin gh-pages
git push --set-upstream origin output
```

## Continuous integration
Expand Down Expand Up @@ -124,7 +115,13 @@ git rm .appveyor.yml
git rm ci/install.sh
```

GitHub Actions is able to deploy without any setup using the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) for authentication.
GitHub Actions is _usually_ able to deploy without any setup using the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token) for authentication.
GitHub Pages deployment using `GITHUB_TOKEN` recently started working on GitHub without an official announcement.
If it does not work for you after completing this setup, try reselecting "gh-pages branch" as the Source for GitHub Pages in the repository Settings.
GitHub Pages should now trigger on the next commit.
If not, [let us know](https://github.com/manubot/rootstock/issues/new).
For more reliable deployment on GitHub, you can also use an SSH Deploy Key instead (see below).

Deploying on Travis CI requires creating an SSH Deploy Key.
The following sections, collapsed by default, detail how to generate an SSH Deploy Key.

Expand Down
3 changes: 2 additions & 1 deletion ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ fi
# Fetch and create gh-pages and output branches
# Travis does a shallow and single branch git clone
git remote set-branches --add origin gh-pages output
git fetch origin gh-pages:gh-pages output:output
git fetch origin gh-pages:gh-pages output:output || \
echo >&2 "[INFO] could not fetch gh-pages or output from origin."

# Configure versioned webpage and timestamp
manubot webpage \
Expand Down

0 comments on commit c25f8b8

Please sign in to comment.