Skip to content

Commit

Permalink
feat(report): add Hugo for report and ci deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
manuandru committed May 17, 2024
1 parent ee92406 commit b4d125c
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 7 deletions.
35 changes: 29 additions & 6 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ jobs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
env:
HUGO_VERSION: 0.126.1
TMP_SITE: tmp-site
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -126,6 +129,9 @@ jobs:
- run: echo "Deploying version ${{ needs.release.outputs.version }} to GitHub Page"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod for Hugo
- uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -134,22 +140,39 @@ jobs:
uses: actions/configure-pages@v5
- name: Create artifacts directory
run: |
mkdir -p ./tmp-site
cp ./resources/index-github-pages.html ./tmp-site/index.html
mkdir -p ${{ env.TMP_SITE }}
cp ./resources/index-github-pages.html ${{ env.TMP_SITE }}/index.html
- name: Build documentation
run: |
./gradlew -PforceVersion=${{ needs.release.outputs.version }} dokkaHtmlMultiModule --parallel
cp -r ./build/dokka/htmlMultiModule ./tmp-site/docs
cp -r ./build/dokka/htmlMultiModule ${{ env.TMP_SITE }}/docs
- name: Build Open API documentation
run: |
./gradlew buildOpenApiSite --parallel
cp -r ./build/openapi-site ./tmp-site/openapi
cp -r ./build/openapi-site ${{ env.TMP_SITE }}/openapi
# - name: Copy features report
# run: cp -r ./build/reports/tests/test ./tmp-site/features
# run: cp -r ./build/reports/tests/test ${{ env.TMP_SITE }}features
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${{ env.HUGO_VERSION }}/hugo_extended_${{ env.HUGO_VERSION }}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
sudo snap install dart-sass
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
- name: Build Hugo report site
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--source ./resources/report \
--destination ../../${{ env.TMP_SITE }}/report \
--baseURL "${{ steps.pages.outputs.base_url }}/piper-kt/report/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3.0.1
with:
path: ./tmp-site
path: ${{ env.TMP_SITE }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4.0.5
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "resources/report/themes/hugo-book"]
path = resources/report/themes/hugo-book
url = https://github.com/alex-shpak/hugo-book
8 changes: 7 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ subprojects {
spotless {
yaml {
target("**/*.yml", "**/*.yaml")
targetExclude("**/build/**", "**/node_modules/**", "**/helm-chart/**", "auth.yml")
targetExclude(
"**/build/**",
"**/node_modules/**",
"**/helm-chart/**",
"auth.yml",
"resources/report/**",
)
prettier()
}
}
Expand Down
4 changes: 4 additions & 0 deletions resources/index-github-pages.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ <h2>Documentation</h2>
<a href="https://github.com/zucchero-sintattico/piper-kt">GitHub Repo</a>
<img alt="Static Badge" class="uk-align-right" src="https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white">
</li>
<li>
<a href="./report">Report</a>
<img alt="Static Badge" class="uk-align-right" src="https://img.shields.io/badge/Hugo-black.svg?style=for-the-badge&logo=Hugo">
</li>
<li>
<a href="./docs">Kotlin docs</a>
<img alt="Static Badge" class="uk-align-right" src="https://img.shields.io/badge/kotlindocs-%237F52FF.svg?style=for-the-badge&logo=kotlin&logoColor=white">
Expand Down
3 changes: 3 additions & 0 deletions resources/report/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hugo_build.lock
public
resources/_gen/**
61 changes: 61 additions & 0 deletions resources/report/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# hugo server --minify

baseURL = 'https://zucchero-sintattico.github.io/'
title = 'Piper Kt'
theme = 'hugo-book'

# Book configuration
disablePathToLower = true
enableGitInfo = true

# Needed for mermaid/katex shortcodes
[markup]
[markup.goldmark.renderer]
unsafe = true

[markup.tableOfContents]
startLevel = 1

[menu]
[[menu.after]]
name = "Github"
url = "https://github.com/zucchero-sintattico/piper-kt"
weight = 100

[params]
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme = 'light'

# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
# BookRepo = 'https://github.com/zucchero-sintattico/piper-kt'

# Enable "Edit this page" links for 'doc' page type.
# Disabled by default. Uncomment to enable. Requires 'BookRepo' param.
# Edit path must point to root directory of repo.
# BookEditPath = 'resources/report'

# Configure the date format used on the pages
# - In git information
# - In blog posts
BookDateFormat = 'January 2, 2006'

# (Optional, default true) Enables search function with flexsearch,
# Index is built on fly, therefore it might slowdown your website.
# Configuration for indexing can be adjusted in i18n folder per language.
BookSearch = true

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables portable links and link checks in markdown pages.
# Portable links meant to work with text editors and let you write markdown without {{< relref >}} shortcode
# Theme will print warning if page referenced in markdown does not exists.
BookPortableLinks = true

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker = true

# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly = false
18 changes: 18 additions & 0 deletions resources/report/content/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Introduction
type: docs
---

# Piper Kt

## Members

- [Manuel Andruccioli](mailto:manuel.andruccioli@studio.unibo.it)
- [Alessandro Mazzoli](mailto:alessandro.mazzoli9@studio.unibo.it)
- [Tommaso Patriti](mailto:tommaso.patriti@studio.unibo.it)
- [Luigi Borriello](mailto:luigi.borriello2@studio.unibo.it)

## Scenario

The project consists of creating a platform that enables real-time communication between users in various form, inspired by Discord.
Piper-kt will offer the possibility of registration and access through a login system, allowing users to establish and manage social connections through friend requests. The platform will facilitate intra-user communication, with notifications for messages and management of friendships. Users will have the freedom to create and manage their own servers, with features for managing text and multimedia channels. It will be possible to send messages, participate in voice and video calls, and manage webcams and microphones within channels. In addition, server creators will be able to moderate them, removing unwanted members.
13 changes: 13 additions & 0 deletions resources/report/content/docs/01-requirements/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: "Requirements"
weight: 1
# bookFlatSection: false
# bookToc: true
# bookHidden: false
# bookCollapseSection: false
# bookComments: false
# bookSearchExclude: false
---

# Requirements

6 changes: 6 additions & 0 deletions resources/report/content/docs/02-design/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Design"
weight: 2
---

# Design
1 change: 1 addition & 0 deletions resources/report/themes/hugo-book
Submodule hugo-book added at f8a0fc

0 comments on commit b4d125c

Please sign in to comment.