Add deploy config
This commit is contained in:
parent
d239094dbe
commit
cbe6a36ee8
7 changed files with 52 additions and 14 deletions
32
.github/workflows/deploy.yml
vendored
Normal file
32
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: fkirc/skip-duplicate-actions@master
|
||||
- uses: actions/checkout@v2
|
||||
- uses: gradle/wrapper-validation-action@v1
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
|
||||
- name: Generate messages
|
||||
run: ./gradlew run
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@3.7.1
|
||||
with:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BRANCH: gh-pages
|
||||
FOLDER: dist/
|
||||
CLEAN: true
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -72,3 +72,4 @@ gradle-app.setting
|
|||
classes
|
||||
.DS_Store
|
||||
.idea/libraries-with-intellij-classes.xml
|
||||
dist/messages.json
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
# messages
|
||||
# Wulkanowy Messages
|
||||
|
||||
Go to https://wulkanowy.github.io/messages/
|
||||
|
|
12
build.gradle
12
build.gradle
|
@ -18,15 +18,3 @@ allprojects {
|
|||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
11
dist/index.html
vendored
Normal file
11
dist/index.html
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<title>Wulkanowy Messages</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="messages.json">Open messages.json</a>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +1,12 @@
|
|||
plugins {
|
||||
id 'java'
|
||||
id 'application'
|
||||
id 'org.jetbrains.kotlin.jvm'
|
||||
id 'org.jetbrains.kotlin.plugin.serialization'
|
||||
}
|
||||
|
||||
mainClassName = 'MainKt'
|
||||
|
||||
dependencies {
|
||||
implementation project(":pojos")
|
||||
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0"
|
||||
|
|
|
@ -2,6 +2,7 @@ import io.github.wulkanowy.messages.pojo.Message
|
|||
import io.github.wulkanowy.messages.pojo.MessageType
|
||||
import kotlinx.serialization.encodeToString
|
||||
import kotlinx.serialization.json.Json
|
||||
import java.io.File
|
||||
|
||||
val messages = listOf(
|
||||
Message(
|
||||
|
@ -14,5 +15,5 @@ val messages = listOf(
|
|||
|
||||
fun main() {
|
||||
val json = Json.encodeToString(messages)
|
||||
println(json)
|
||||
File("../dist/messages.json").writeText(json)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue