From 7b7f4aaa19dff1574971aa74a3eb0b3c35529941 Mon Sep 17 00:00:00 2001 From: Fabio Epifani Date: Sat, 10 Feb 2024 23:34:24 +0000 Subject: [PATCH] Publish to gh pages --- .github/workflows/main.yml | 35 ++++++++++++++++--- build.sbt | 2 +- modules/backend/src/main/resources/index.html | 14 ++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 modules/backend/src/main/resources/index.html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d141876..3293b53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,11 +1,11 @@ -name: Build and test +name: Publish to Github pages on: push: branches: [main] jobs: - test: + build: runs-on: ubuntu-latest steps: - name: Checkout @@ -20,6 +20,31 @@ jobs: with: node-version: 12 - name: Build - run: sbt compile Test/compile - - name: Test - run: sbt domainJVM/test frontend/fullLinkJS # todo: scalajs testing + run: sbt frontend/fullLinkJS + - name: Prepare artifact + run: | + mkdir artifact + cp modules/frontend/target/scala-3.3.1/frontend-opt/main.js artifact/main.js + cp -r modules/backend/src/main/resources/static artifact/static + cp modules/backend/src/main/resources/index.html artifact/index.html + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + path: artifact + + deploy: + needs: build + + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/build.sbt b/build.sbt index a69b68a..97e9582 100644 --- a/build.sbt +++ b/build.sbt @@ -81,7 +81,7 @@ lazy val backend = (project in file("modules/backend")) "org.scalatest" %% "scalatest" % scalaTestVersion % Test, "org.typelevel" %% "cats-effect-testing-scalatest" % catsEffectTestingVersion % Test ), - scalaJSProjects := Seq(), // frontend), + scalaJSProjects := Seq(frontend), // frontend), exportJars := true, resolvers ++= Resolver.sonatypeOssRepos("snapshots"), resolvers += Resolver.bintrayRepo("hseeberger", "maven"), diff --git a/modules/backend/src/main/resources/index.html b/modules/backend/src/main/resources/index.html new file mode 100644 index 0000000..f5a094e --- /dev/null +++ b/modules/backend/src/main/resources/index.html @@ -0,0 +1,14 @@ + + + Controbuio + + + + + +
+

Controbuio

+
+ + + \ No newline at end of file