Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GitHub api to publish ghpages #169

Merged
merged 7 commits into from
Apr 21, 2017

Conversation

fedefernandez
Copy link
Contributor

This PR replaces the publishMicrosite task with a command. Now, depending of the micrositePushSiteWith setting value, the plugin will publish the site with sbt-ghpages or github4s API.

Please @juanpedromoreno, could you review? Thanks!

Copy link
Member

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great!!! I've added some minor literature comments that can be addressed if they make sense.

giphy 7

@@ -25,18 +25,25 @@ If you're running the microsite locally, you can follow these steps:

# Publish the microsite

From version [`0.5.4`](https://github.com/47deg/sbt-microsites/releases/tag/v0.5.4), you have two options for publishing the site:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--for publishing
++to publish

@@ -25,18 +25,25 @@ If you're running the microsite locally, you can follow these steps:

# Publish the microsite

From version [`0.5.4`](https://github.com/47deg/sbt-microsites/releases/tag/v0.5.4), you have two options for publishing the site:
* **sbt-ghpages**: This is the default method. It uses the sbt-git plugin and the local ssh keys for pushing the changes.
* **github4s**: Avoids using local ssh keys, publishing the site with the GitHub web API. By contrast, you need to specify a token.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--publishing the site with the GitHub web API
++publishing the site through the GitHub HTTP API and [Github4s](https://github.com/47deg/github4s).


You need to create a GitHub token with `repo` scope. You can create it in the [GitHub settings](https://github.com/settings/tokens/new?scopes=repo&description=sbt-microsites) page.

Copy the token in a safe place, we'll send the token through an environment variable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--we'll send the token through an environment variable.
++we'll use this token through an environment variable as we'll see shortly.


**2- Configure your project build**

You need to set these two properties:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--properties
++sbt settings


```
micrositeGithubOwner := "47deg"
micrositeGithubRepo := "sbt-microsites"
```

- `micrositeGithubToken`: used for publishing the site when `github4s` is enabled. A [token with repo scope](https://github.com/settings/tokens/new?scopes=repo&description=sbt-microsites) is needed. None by default:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--None by default:
++None by default, but you can override it in this way:

@fedefernandez fedefernandez changed the title Use GitHub api for publishing ghpages Use GitHub api to publish ghpages Apr 21, 2017
@fedefernandez fedefernandez merged commit c0ef3d5 into master Apr 21, 2017
@fedefernandez fedefernandez deleted the ff-use-github-api-for-publishing-ghpages branch April 21, 2017 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants