From eaf766a08f74b6bec00732888c364a1a40256e3b Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 4 Apr 2023 18:50:34 -0400 Subject: [PATCH 1/4] Init of wiki template --- .github/workflows/build.yml | 41 +++++++++++++++++++ LICENSE | 9 +++++ README.md | 7 ++++ docs/CNAME | 1 + docs/index.md | 16 ++++++++ mkdocs.yml | 78 +++++++++++++++++++++++++++++++++++++ requirements.txt | 7 ++++ 7 files changed, 159 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 LICENSE create mode 100644 README.md create mode 100644 docs/CNAME create mode 100644 docs/index.md create mode 100644 mkdocs.yml create mode 100644 requirements.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..81dbb32 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +--- +name: mkdocs build +on: + push: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + container: + image: docker.io/rockylinux:9 + steps: + - name: Install deps + run: dnf -y install git python3 python3-pip + + - name: setup ssh + env: + SSH_KEY: "${{ secrets.SSH_KEY }}" + run: | + mkdir -p ~/.ssh/ + echo "$SSH_KEY" > ~/.ssh/id_rsa + chmod 0700 ~/.ssh/ + chmod 0600 ~/.ssh/id_rsa + + - name: checkout + env: + GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + run: + git clone https://git.resf.org/$GITHUB_REPOSITORY.git $GITHUB_WORKSPACE + + - name: Install python requirements + run: python3 -m pip install -r requirements.txt + + - name: Deploy + env: + GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" + GIT_AUTHOR_NAME: "Rocky Bot" + GIT_AUTHOR_EMAIL: "auto@rockylinux.org" + run: | + git remote set-url origin ssh://git@git.resf.org:22220/$GITHUB_REPOSITORY.git + python3 -m mkdocs gh-deploy --force diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2071b23 --- /dev/null +++ b/LICENSE @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0a5ef85 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# REPLACEME Wiki + +@TODO - fill in :) + +## Continuous Integration / Continuous Deployment + +Actions Runner executes workflow to publish to https://REPLACEME.rocky.page on push to main. diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..f3adce1 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +REPLACEME.rocky.page diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..c025f75 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,16 @@ +# REPLACEME Wiki + +## Links + +## Responsibilities + +## Meetings / Communications + +## Members + +## Project layout + + mkdocs.yml # The configuration file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000..30be3e8 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,78 @@ +--- +# Project information +site_name: REPLACEME Wiki +site_url: https://REPLACEME.rocky.page +site_description: >- + REPLACEME + +# Repository +repo_url: https://git.resf.org/REPLACEME/wiki +repo_name: sig_ai/wiki +edit_uri: _edit/main/docs/ + +# Copyright +copyright: Copyright © 2023 Rocky Enterprise Software Foundation + +# Configuration +theme: + name: material + logo: assets/icon-white.svg + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + primary: teal + accent: teal + toggle: + icon: material/weather-night + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + primary: teal + accent: teal + toggle: + icon: material/weather-sunny + name: Switch to light mode + highlightjs: true + hljs_languages: + - bash + - perl + - python + - yaml + features: + - navigation.expand + - navigation.indexes + - navigation.instant + - navigation.sections + - navigation.top + - navigation.tracking + - navigation.path + - search.highlight + - search.suggest + - toc.integrate + - content.action.edit + +# Plugins +plugins: + - autolinks + - awesome-pages + - git-revision-date-localized: + type: date + - search + +# Extensions +markdown_extensions: + - abbr + - admonition + - attr_list + - def_list + - footnotes + - meta + - pymdownx.details # this allows collapsible attributions + - pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + - toc: + permalink: true diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..84fdbd7 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,7 @@ +mkdocs +mkdocs-autolinks-plugin +mkdocs-awesome-pages-plugin +mkdocs-git-revision-date-localized-plugin +mkdocs-macros-plugin +mkdocs-material +mkdocs-windmill From 682d3b18a727326407f5f3613560f490c78864bd Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 4 Apr 2023 22:55:29 +0000 Subject: [PATCH 2/4] Update 'mkdocs.yml' --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 30be3e8..832aaf5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,7 +7,7 @@ site_description: >- # Repository repo_url: https://git.resf.org/REPLACEME/wiki -repo_name: sig_ai/wiki +repo_name: REPLACEME/wiki edit_uri: _edit/main/docs/ # Copyright From fcb1b46e82a09567b92b714c2314943558b9d6cb Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 2 May 2023 10:43:30 -0400 Subject: [PATCH 3/4] forgot to include the favicon... --- docs/assets/icon-white.svg | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 docs/assets/icon-white.svg diff --git a/docs/assets/icon-white.svg b/docs/assets/icon-white.svg new file mode 100644 index 0000000..689ab46 --- /dev/null +++ b/docs/assets/icon-white.svg @@ -0,0 +1,3 @@ + + + From eec21c5e028630b6601b4bb273aaf31c711795e8 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Wed, 14 Feb 2024 18:12:15 -0500 Subject: [PATCH 4/4] update template, add dev container --- .github/workflows/build.yml | 6 +++--- .gitignore | 1 + Containerfile | 8 ++++++++ README.md | 26 ++++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ docs/index.md | 6 ------ mkdocs.yml | 6 +++--- requirements.txt | 1 + 8 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 .gitignore create mode 100644 Containerfile create mode 100644 docker-compose.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 81dbb32..a2ac24a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: image: docker.io/rockylinux:9 steps: - name: Install deps - run: dnf -y install git python3 python3-pip + run: dnf -y install git python3 python3-pip cairo-devel - name: setup ssh env: @@ -30,9 +30,9 @@ jobs: - name: Install python requirements run: python3 -m pip install -r requirements.txt - + - name: Deploy - env: + env: GIT_SSH_COMMAND: "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" GIT_AUTHOR_NAME: "Rocky Bot" GIT_AUTHOR_EMAIL: "auto@rockylinux.org" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45ddf0a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +site/ diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..2c37103 --- /dev/null +++ b/Containerfile @@ -0,0 +1,8 @@ +FROM quay.io/rockylinux/rockylinux:9 + +RUN dnf -y upgrade +RUN dnf install -y git python3 python3-pip cairo-devel + +COPY . /wiki +WORKDIR /wiki +RUN pip install -r requirements.txt diff --git a/README.md b/README.md index 0a5ef85..ebbf5f5 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,29 @@ ## Continuous Integration / Continuous Deployment Actions Runner executes workflow to publish to https://REPLACEME.rocky.page on push to main. + +## Building Locally + +In order to build this wiki locally, a docker-compose configuration and container file are supplied which when invoked, will launch mkdocs' development server in a container bound to port 8000 and will live-reload when changes are made to the wiki files. + +To run the containers on your system, invoke podman or docker compose like so: + +``` +podman-compose -f docker-compose.yml up -d +``` + +The container will build and then launch itself. Afterwards, you should be able to view the wiki content at http://localhost:8000. + +The compose file accepts a build argument if you need to run it on a different port. For example, to bind to port 8080 on your local machine: + +``` +podman-compose -f docker-compose --build-arg PORT=8080 up -d +``` + +## Project layout + + mkdocs.yml # The configuration file. + README.md # This file. + docs/ + index.md # The documentation homepage. + ... # Other markdown pages, images and other files. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7d7ca2f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +--- +version: '3' + +services: + wiki: + build: + context: . + dockerfile: Containerfile + command: ["mkdocs", "serve","--dev-addr", "0.0.0.0:${PORT:-8000}"] + volumes: + - .:/wiki:z,rw + ports: + - "${PORT:-8000}:8000" diff --git a/docs/index.md b/docs/index.md index c025f75..cb82ac7 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,9 +8,3 @@ ## Members -## Project layout - - mkdocs.yml # The configuration file. - docs/ - index.md # The documentation homepage. - ... # Other markdown pages, images and other files. diff --git a/mkdocs.yml b/mkdocs.yml index 832aaf5..d7c9979 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,7 +11,7 @@ repo_name: REPLACEME/wiki edit_uri: _edit/main/docs/ # Copyright -copyright: Copyright © 2023 Rocky Enterprise Software Foundation +copyright: Copyright © 2024 Rocky Enterprise Software Foundation # Configuration theme: @@ -69,8 +69,8 @@ markdown_extensions: - meta - pymdownx.details # this allows collapsible attributions - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.superfences - pymdownx.tabbed: alternate_style: true diff --git a/requirements.txt b/requirements.txt index 84fdbd7..faf266f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ mkdocs-git-revision-date-localized-plugin mkdocs-macros-plugin mkdocs-material mkdocs-windmill +mkdocs-material[imaging]