Skip to content

Commit

Permalink
Merge pull request #42 from BlazingTwist/41-automate-pages
Browse files Browse the repository at this point in the history
41 automate pages deployment
  • Loading branch information
BlazingTwist authored Jan 12, 2024
2 parents 4e7526b + 3f845f0 commit d50d77c
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# This is a basic workflow to help you get started with Actions

name: Generate GitHub Pages

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Generate Javadoc and Api-docs
runs-on: ubuntu-latest
permissions:
checks: write
contents: read
steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
java-version: '20'
distribution: 'temurin'
cache: maven
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install ApiDoc Generators
run: |
npm install -g @asyncapi/generator
npm install -g @redocly/cli
- name: Generate JavaDoc
run: mvn clean compile javadoc:javadoc

- name: Generate ApiDoc
run: |
ag --output ./docs/api-docs/asyncapi/ ./src/main/resources/dx/AsyncApi.schema.yml @asyncapi/html-template
redocly build-docs ./src/main/resources/dx/Swagger.schema.yml --output=./docs/api-docs/swagger.html
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload docs dir
uses: actions/upload-pages-artifact@v2
with:
path: './docs'
- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ fabric.properties
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

docs/api-docs
docs/java-docs

target
/logs/
/src/main/jchess-web/api-docs
Expand Down
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>JChess Docs</title> <link rel="stylesheet" href="style.css"></head><body style="padding: 0; margin: 0"> <div style="width: 100vw; height: 100vh; display: flex; flex-direction: column; gap: 30px; align-items: center; justify-content: center" id="buttonPanel"> <button class="docs-button" role="button" onclick="window.location.href='java-docs/index.html';">Open Java-Docs</button> <button class="docs-button" role="button" onclick="window.location.href='api-docs/swagger.html';">Open Swagger (REST API) Docs</button> <button class="docs-button" role="button" onclick="window.location.href='api-docs/asyncapi/index.html';">Open AsyncAPI (WebSocket API) Docs</button> </div></body></html>
Expand Down
37 changes: 37 additions & 0 deletions docs/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* CSS */
.docs-button {
appearance: button;
backface-visibility: hidden;
background-color: #405cf5;
border-radius: 6px;
border-width: 0;
box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset,rgba(50, 50, 93, .1) 0 2px 5px 0,rgba(0, 0, 0, .07) 0 1px 1px 0;
box-sizing: border-box;
color: #fff;
cursor: pointer;
font-family: -apple-system,system-ui,"Segoe UI",Roboto,"Helvetica Neue",Ubuntu,sans-serif;
font-size: 100%;
height: 44px;
line-height: 1.15;
margin: 12px 0 0;
outline: none;
overflow: hidden;
padding: 0 25px;
position: relative;
text-align: center;
text-transform: none;
transform: translateZ(0);
transition: all .2s,box-shadow .08s ease-in;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
width: max(30vw, 300px);
}

.docs-button:disabled {
cursor: default;
}

.docs-button:focus {
box-shadow: rgba(50, 50, 93, .1) 0 0 0 1px inset, rgba(50, 50, 93, .2) 0 6px 15px 0, rgba(0, 0, 0, .1) 0 2px 2px 0, rgba(50, 151, 211, .3) 0 0 0 4px;
}
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@
</execution>
</executions>
</plugin>

<!-- Generierung des Online JavaDocs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.3</version>
<configuration>
<outputDirectory>${project.basedir}/docs</outputDirectory>
<reportOutputDirectory>${project.basedir}/docs</reportOutputDirectory>
<destDir>java-docs</destDir>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit d50d77c

Please sign in to comment.