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

Checkout lfs assets in the pages build. #78

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -103,6 +106,9 @@ jobs:
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -237,13 +243,16 @@ jobs:

dependency-submission:
name: Submit Dependencies
if: github.event_name != 'pull_request'
if: github.event.repository.fork == false && github.event_name != 'pull_request'
strategy:
matrix:
os: [ubuntu-latest]
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -301,10 +310,14 @@ jobs:
java: [temurin@11]
runs-on: ${{ matrix.os }}
steps:
- name: Install sbt
uses: sbt/setup-sbt@v1

- name: Checkout current branch (full)
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true

- name: Setup Java (temurin@11)
id: setup-java-temurin-11
Expand All @@ -324,7 +337,7 @@ jobs:

- name: Publish site
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3.9.3
uses: peaceiris/actions-gh-pages@v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: site/target/docs/site
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,13 @@ yarn start

If you're only changing `.md` files, you can run `sbt '~docs/mdoc'`.

If you want to view images, such as the logo, use `git lfs` to check them out:

```bash
git lfs install --local
git lfs pull
```

Note that the site will look a tiny bit different because to build a versioned website we have some machinery in the script running on CI - but you don't have to worry about that.

### PR Guidelines
Expand Down
20 changes: 17 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import _root_.cats.syntax.all.*
import laika.helium.config.TextLink
import laika.helium.config.ReleaseInfo
import laika.helium.config.HeliumIcon
Expand All @@ -9,7 +10,6 @@ import laika.ast.Image
import laika.config.LinkValidation
import org.typelevel.sbt.site.TypelevelSiteSettings
import sbt.librarymanagement.Configurations.ScalaDocTool

// https://typelevel.org/sbt-typelevel/faq.html#what-is-a-base-version-anyway
ThisBuild / tlBaseVersion := "0.0" // your current series x.y

Expand All @@ -23,8 +23,8 @@ ThisBuild / developers := List(

ThisBuild / tlCiHeaderCheck := false

// publish to s01.oss.sonatype.org (set to true to publish to oss.sonatype.org instead)
ThisBuild / tlSonatypeUseLegacyHost := false
// publish to s01.oss.sonatype.org
ThisBuild / sonatypeCredentialHost := Sonatype.sonatypeLegacy

// enable the sbt-typelevel-site laika documentation
ThisBuild / tlSitePublishBranch := Some("main")
Expand Down Expand Up @@ -187,6 +187,20 @@ lazy val docsOutput = crossProject(JVMPlatform)
lazy val docs = project
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.settings(
ThisBuild / githubWorkflowAddedJobs ~= {
// Checkout site assets from LFS
_.map {
case job: WorkflowJob if job.name === "Generate Site" =>
job.withSteps(job.steps.map {
case step: WorkflowStep.Use
if step.name === Some("Checkout current branch (full)") =>
step.updatedParams("lfs", "true")
case other => other
})
case other => other
}
})
.dependsOn(
core.jvm,
framework.jvm,
Expand Down
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0"

addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")

addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.4")

addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.0")
addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.4")

addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")

Expand Down