Skip to content

Commit

Permalink
Merge pull request #78 from zainab-ali/lfs-fix
Browse files Browse the repository at this point in the history
Checkout `lfs` assets in the pages build.
  • Loading branch information
zainab-ali authored Nov 7, 2024
2 parents 5b9e5a2 + c003632 commit dced538
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
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

0 comments on commit dced538

Please sign in to comment.