Skip to content

Commit

Permalink
ci: create docker workflow and ci to publish gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
edouard-lopez committed Jan 19, 2024
1 parent 50d756b commit 618c943
Show file tree
Hide file tree
Showing 8 changed files with 164 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,7 @@ jobs:
if: contains(github.ref, 'master')
uses: ./.github/workflows/bump-version.yml
secrets: inherit

publish-doc:
uses: ./.github/workflows/doc.yml
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish docs via GitHub Pages
on:
push:
branches:
- master
paths:
- docs/

pull_request:
# types:
# - opened
# - reopened
# - synchronize
# - ready_for_review
paths:
- docs/
workflow_call:

jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REQUIREMENTS: docs/requirements.txt
20 changes: 5 additions & 15 deletions docker/doc.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
FROM python:3
FROM squidfunk/mkdocs-material:latest

# Create app directory
WORKDIR /usr/src/app
COPY ./docs/requirements.txt /docs/
RUN pip install -r ./requirements.txt

RUN pip install \
mkdocs \
mkdocs-pdf-export-plugin \
mkdocs-material

COPY . .

# RUN mkdocs build

EXPOSE 8000
# CMD ["python", "-m", "http.server", "8000", "-d", "./site"]
CMD ["mkdocs" "serve" "--clean"]
ENTRYPOINT ["mkdocs"]
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
17 changes: 17 additions & 0 deletions docker/doc.old.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM python:3

# Create app directory
WORKDIR /usr/src/app

RUN pip install \
mkdocs \
mkdocs-pdf-export-plugin \
mkdocs-material

COPY . .

# RUN mkdocs build

EXPOSE 8000
# CMD ["python", "-m", "http.server", "8000", "-d", "./site"]
CMD ["mkdocs" "serve" "--clean"]
81 changes: 81 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
site_name: Pure.fish
site_description: " Pretty, minimal and fast Fish 🐟 prompt"
site_author: "Édouard Lopez"
docs_dir: ./
repo_name: "pure-fish/pure"
repo_url: "https://github.com/pure-fish/pure"
nav:
- Home: index.md
theme:
# name: "material"
name: "material"
include_sidebar: true
features:
- navigation.tabs
- navigation.tracking
- navigation.expand
- navigation.indexes
# logo: pure.png
# favicon: pure.png
icon:
repo: fontawesome/brands/gitlab
admonition:
note: octicons/tag-16
abstract: octicons/checklist-16
info: octicons/info-16
tip: octicons/light-bulb-16
success: octicons/check-16
question: octicons/question-16
warning: octicons/alert-16
failure: octicons/x-circle-16
danger: octicons/zap-16
bug: octicons/bug-16
example: octicons/beaker-16
quote: octicons/quote-16
palette:
- scheme: default
primary: teal
accent: teal
toggle:
icon: material/toggle-switch-off-outline
name: Switch to dark mode
- scheme: slate
primary: teal
accent: teal
toggle:
icon: material/toggle-switch
name: Switch to light mode
font:
text: Open Sans
code: Roboto Mono

extra:
analytics:
provider: google
property: G-LRFT4E69D4
social:
- icon: fontawesome/brands/slack
link: https://manomano-team.slack.com/archives/C02USRC7F9T

markdown_extensions:
- admonition
# - attr_list
# - md_in_html
- pymdownx.details
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
# - toc:
# permalink: true


plugins:
- search
- awesome-pages
- include-markdown
4 changes: 4 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pymdown-extensions
mkdocs-material
mkdocs-awesome-pages-plugin
mkdocs-include-markdown-plugin
24 changes: 21 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ test-pure-on-nix:
$(MAKE) dev-pure-on-nix CMD="${CMD}" TTY=


build-pure-doc:
build-pure-doc-old:
docker build \
--file ./docker/doc.Dockerfile \
--file ./docker/doc.old.Dockerfile \
--tag=pure-doc \
--load \
./

serve-pure-doc:
serve-pure-doc-old:
docker run \
--name mkdocs \
--tty \
Expand All @@ -108,3 +108,21 @@ serve-pure-doc:
--env ADD_MODULES="pymdown-extensions mkdocs-material mkdocs-awesome-pages-plugin mkdocs-include-markdown-plugin" \
--volume=$$(pwd):/mkdocs \
polinux/mkdocs

serve-pure-doc:
docker run \
--name mkdocs \
--tty \
--interactive \
--rm \
--publish 8000:8000 \
--volume=$$(pwd):/docs \
pure-doc


build-pure-doc:
docker build \
--file ./docker/doc.Dockerfile \
--tag=pure-doc \
--load \
./
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
# - toc:
# permalink: true
Expand Down

0 comments on commit 618c943

Please sign in to comment.