Commit 598b515b authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): add docs support

parent 8ebf2e43
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
# This workflow will check flake style
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Docs Deploy

on:
  push:
    branches: [ main, 'doc/*', 'dev/*' ]
  release:
    types: [ published ]

jobs:
  doc:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, 'ci skip')"
    strategy:
      matrix:
        python-version: [ 3.7 ]

    services:
      plantuml:
        image: plantuml/plantuml-server
        ports:
          - 18080:8080

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          fetch-depth: 20
          submodules: 'recursive'
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Install dependencies
        run: |
          sudo apt-get update -y
          sudo apt-get install -y make wget curl cloc graphviz
          dot -V
          python -m pip install -r requirements.txt
          python -m pip install -r requirements-doc.txt
      - name: Generate
        env:
          ENV_PROD: 'true'
          PLANTUML_HOST: http://localhost:18080
        run: |
          git fetch --all --tags
          git branch -av
          git remote -v
          git tag
          plantumlcli -c
          make pdocs
          mv ./docs/build/html ./public
      - name: Deploy to Github Page
        uses: JamesIves/github-pages-deploy-action@3.7.1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GIT_CONFIG_NAME: narugo1992
          GIT_CONFIG_EMAIL: narugo@126.com
          BRANCH: gh-pages # The branch the action should deploy to.
          FOLDER: public # The folder the action should deploy.
          CLEAN: true # Automatically remove deleted files from the deploy branch

docs/Makefile

0 → 100644
+44 −0
Original line number Diff line number Diff line
# You can set these variables from the command line, and also
# from the environment for the first two.
PROJ_DIR           ?= ${CURDIR}
SPHINXOPTS         ?=
SPHINXBUILD        ?= $(shell which sphinx-build)
SPHINXMULTIVERSION ?= $(shell which sphinx-multiversion)
SOURCEDIR          ?= ${PROJ_DIR}/source
BUILDDIR           ?= ${PROJ_DIR}/build

# Minimal makefile for Sphinx documentation
ALL_MK := ${SOURCEDIR}/all.mk
ALL    := $(MAKE) -f "${ALL_MK}" SOURCE=${SOURCEDIR}

.EXPORT_ALL_VARIABLES:

NO_CONTENTS_BUILD = true

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
# Put it first so that "make" without argument is like "make help".
.PHONY: help contents build html prod clean sourcedir builddir Makefile

help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

contents:
	@$(ALL) build
build: html
html: contents
	@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
	@touch "$(BUILDDIR)/html/.nojekyll"
prod:
	@NO_CONTENTS_BUILD='' $(SPHINXMULTIVERSION) "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
	@cp main_page.html "$(BUILDDIR)/html/index.html"
	@touch "$(BUILDDIR)/html/.nojekyll"

clean:
	@$(ALL) clean
	@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

sourcedir:
	@echo $(shell readlink -f ${SOURCEDIR})
builddir:
	@echo $(shell readlink -f ${BUILDDIR}/html)
 No newline at end of file

docs/main_page.html

0 → 100644
+9 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<html>
<head>
    <title>Redirecting to master branch</title>
    <meta charset="utf-8">
    <meta http-equiv="refresh" content="0; url=./main/index.html">
    <link rel="canonical" href="./main/index.html">
</head>
</html>
 No newline at end of file
+0 −0

Empty file added.

+0 −0

Empty file added.

Loading