Skip to content

Commit

Permalink
workflows/docs: Change mkdocs with gohugo
Browse files Browse the repository at this point in the history
Signed-off-by: Arisu Tachibana <[email protected]>
  • Loading branch information
aliceinwire committed Nov 20, 2024
1 parent 5e512bc commit 49478e8
Show file tree
Hide file tree
Showing 7 changed files with 126 additions and 49 deletions.
77 changes: 65 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,75 @@
---
name: Docs

permissions:
contents: write
actions: write
name: Deploy Hugo site to Pages

on:
push:
branches:
- main

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
deploy:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.137.1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install Node.js dependencies
run: |
[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true
npm install -D autoprefixer
npm install -D postcss-cli
npm install -D postcss
- name: Build with Hugo
env:
HUGO_CACHEDIR: ${{ runner.temp }}/hugo_cache
HUGO_ENVIRONMENT: production
TZ: America/Los_Angeles
run: |
git clone --depth 1 --branch v0.11.0 https://github.com/google/docsy.git themes/docsy
git clone --depth 1 --branch 6.7.0 https://github.com/FortAwesome/Font-Awesome.git themes/github.com/FortAwesome/Font-Awesome
git clone --depth 1 --branch v5.3.3 https://github.com/twbs/bootstrap.git themes/github.com/twbs/bootstrap
hugo \
--gc \
--theme docsy \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
python-version: 3.11
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
path: ./public

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
16 changes: 13 additions & 3 deletions docs/index.md → docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
+++
title = 'kci-dev'
date = 2024-01-14T07:07:07+01:00
+++

<br>
<br>
<br>
<br>

# kci-dev

kci-dev is a cmdline tool for interact with a enabled KernelCI server
Expand Down Expand Up @@ -78,12 +88,12 @@ kci-dev --settings /path/to/.kci-dev.toml

### checkout

- [checkout](checkout.md)
- [checkout](checkout)

### testretry

- [testretry](testretry.md)
- [testretry](testretry)

### results

- [results](results.md)
- [results](results)
10 changes: 10 additions & 0 deletions docs/checkout.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
+++
title = 'checkout'
date = 2024-01-14T07:07:07+01:00
+++

<br>
<br>
<br>
<br>

## checkout

This command allow to test arbitary commit on the KernelCI Pipeline instance. This might be useful in several cases:
Expand Down
10 changes: 10 additions & 0 deletions docs/results.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
+++
title = 'results'
date = 2024-01-14T07:07:07+01:00
+++

<br>
<br>
<br>
<br>

### results

This command will show the test result by node id.
Expand Down
10 changes: 10 additions & 0 deletions docs/testretry.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
+++
title = 'testretry'
date = 2024-01-14T07:07:07+01:00
+++

<br>
<br>
<br>
<br>

### testretry

This command will retry the failed tests. In some cases tests may fail due to network issues, hardware problems,
Expand Down
18 changes: 18 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
baseURL = 'https://aliceinwire.github.io/kci-dev/'
languageCode = 'en-us'
title = 'kci-dev'
description = 'kci-dev is a cmdline tool for interact with a enabled KernelCI server.'
contentDir = "docs/"

[markup]
[markup.goldmark]
[markup.goldmark.renderer]
unsafe = true

[params.ui]
sidebar_menu_compact = false
breadcrumb_disable = false
sidebar_search_disable = false
navbar_logo = true
footer_about_enable = true
navbar_translucent_over_cover_disable = true
34 changes: 0 additions & 34 deletions mkdocs.yml

This file was deleted.

0 comments on commit 49478e8

Please sign in to comment.