-
Notifications
You must be signed in to change notification settings - Fork 64
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
Use GitHub api to publish ghpages #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--properties
++sbt settings
docs/src/main/tut/docs/settings.md
Outdated
|
||
``` | ||
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: |
There was a problem hiding this comment.
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:
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!