sbt-awss3pages

Build Status Download

Sbt plugin similar to sbt-ghpages, it pushes your sbt-site to Amazon S3. The main advantage over using github pages is the ability to restrict access.

AWS S3 website hosting

To host a website on S3, just follow Amazon's documentation on hosting a static website on Amazon S3.

Installing sbt-awss3pages

Add the plugin to project/plugins.sbt file.

// in project/plugins.sbt
resolvers += Resolver.url("plippe-sbt", url("http://dl.bintray.com/plippe/sbt"))(Resolver.ivyStylePatterns)
addSbtPlugin("com.github.plippe" % "sbt-awss3pages" % "XXX")

Enable the plugin in your build.sbt file.

// in build.sbt
enablePlugins(AwsS3PagesPlugin)

Using sbt-awss3pages

The only requirement is setting the awsS3PagesUri setting in your build.sbt. This AmazonS3URI object represents the S3 folder which will contain the site.

// in build.sbt
awsS3PagesUri := new com.amazonaws.services.s3.AmazonS3URI(
  s"s3://bucket/key/${organization.value}/${name.value}/${version.value}"
)

The awsS3PagesClient setting defaults to AmazonS3ClientBuilder.defaultClient(). It can be overridden with your own Amazon client.

// in build.sbt
awsS3PagesClient := com.amazonaws.services.s3.AmazonS3ClientBuilder
    .standard()
    .withRegion(com.amazonaws.regions.Regions.US_EAST_1)
    .withCredentials(new com.amazonaws.auth.profile.ProfileCredentialsProvider("my-profile"))
    ...
    .build()

Once configured, run sbt awsS3PagesPushSite to push your files to S3.

Pushing scaladoc

sbt-site can easily be used to include Scaladoc with your site.

enablePlugins(SiteScaladocPlugin)
siteSubdirName in SiteScaladoc := "" // move scaladoc at the root of the site