Skip to content

Commit

Permalink
Publish to gh pages
Browse files Browse the repository at this point in the history
  • Loading branch information
epifab committed Feb 10, 2024
1 parent f31badf commit 0b354cc
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 6 deletions.
35 changes: 30 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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-pages-artifacts
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
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
14 changes: 14 additions & 0 deletions modules/backend/src/main/resources/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<html>
<head>
<title>Controbuio</title>
<link rel="stylesheet" href="/static/styles.css" />
<link rel="shortcut icon" href="/static/denari.svg" type="image/svg+xml" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div id="app-wrapper">
<h1><img src="/static/denari.svg" alt="Controbuio" class="spinning" /></h1>
</div>
<script src="main.js"></script>
</body>
</html>

0 comments on commit 0b354cc

Please sign in to comment.