From bd093ee97d0a21f94dc67387ecd4edf53ef96a6b Mon Sep 17 00:00:00 2001 From: eikek Date: Mon, 31 May 2021 13:44:47 +0200 Subject: [PATCH 1/2] Use sbt-github-pages plugin This makes it easier to use within a gitub action. --- build.sbt | 12 ++++-------- project/plugins.sbt | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/build.sbt b/build.sbt index c5d74fe7..8427f7cb 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,5 @@ import com.github.eikek.sbt.openapi._ import scala.sys.process._ -import com.typesafe.sbt.site.SitePlugin import com.typesafe.sbt.SbtGit.GitKeys._ import docspell.build._ @@ -565,18 +564,15 @@ val restserver = project val website = project .in(file("website")) .disablePlugins(RevolverPlugin, ReleasePlugin) - .enablePlugins(ZolaPlugin, GhpagesPlugin) + .enablePlugins(ZolaPlugin, GitHubPagesPlugin) .settings(sharedSettings) .settings( name := "docspell-website", publishArtifact := false, publish / skip := true, - ghpagesNoJekyll := true, - // the ghpages plugins works together with the site plugin (its a dependency) - // to make it publish the zola generated site, override their mappings with the zola output - SitePlugin.autoImport.makeSite / mappings := - Path.selectSubpaths(zolaOutputDir.value, _ => true).toSeq, - git.remoteRepo := "git@github.com:eikek/docspell", + gitHubPagesOrgName := "eikek", + gitHubPagesRepoName := "docspell", + gitHubPagesSiteDir := zolaOutputDir.value, Compile / resourceGenerators += Def.task { val templateOut = baseDirectory.value / "site" / "templates" / "shortcodes" val staticOut = baseDirectory.value / "site" / "static" / "openapi" diff --git a/project/plugins.sbt b/project/plugins.sbt index 79998eef..3074d36c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("com.github.eikek" % "sbt-openapi-schema" % "0.7.1") addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15") addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") -addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3") +addSbtPlugin("io.kevinlee" % "sbt-github-pages" % "0.5.0") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1") addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") From 4f24995fdb3f8becb4e3fd21cc92eaa03cb2418b Mon Sep 17 00:00:00 2001 From: eikek Date: Mon, 31 May 2021 13:57:26 +0200 Subject: [PATCH 2/2] Pin nixpkgs to a version with zola-0.11.0 The site doesn't build without warnings for later versions. Needs cleanup. --- project/build.nix | 13 +++++++------ website/shell.nix | 9 +++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/project/build.nix b/project/build.nix index 21eba62c..755fbd89 100644 --- a/project/build.nix +++ b/project/build.nix @@ -1,13 +1,14 @@ let - nixpkgsUnstable = builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz"; + nixpkgs = builtins.fetchTarball { + ## need fix to zola-0.11.0 for now + url = "https://github.com/NixOS/nixpkgs/archive/92e990a8d6bc35f1089c76dd8ba68b78da90da59.tar.gz"; }; - pkgsUnstable = import nixpkgsUnstable { }; - initScript = pkgsUnstable.writeScript "docspell-build-init" '' + pkgs = import nixpkgs { }; + initScript = pkgs.writeScript "docspell-build-init" '' export LD_LIBRARY_PATH= - ${pkgsUnstable.bash}/bin/bash -c sbt + ${pkgs.bash}/bin/bash -c sbt ''; -in with pkgsUnstable; +in with pkgs; buildFHSUserEnv { name = "docspell-sbt"; diff --git a/website/shell.nix b/website/shell.nix index feb45d35..f759b17e 100644 --- a/website/shell.nix +++ b/website/shell.nix @@ -1,10 +1,11 @@ let - nixpkgsUnstable = builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs-channels/archive/92e990a8d6bc35f1089c76dd8ba68b78da90da59.tar.gz"; + nixpkgs = builtins.fetchTarball { + ## need fix to zola-0.11.0 for now + url = "https://github.com/NixOS/nixpkgs/archive/92e990a8d6bc35f1089c76dd8ba68b78da90da59.tar.gz"; }; - pkgsUnstable = import nixpkgsUnstable { }; + pkgs = import nixpkgs { }; in -with pkgsUnstable; +with pkgs; mkShell { buildInputs = [