mirror of
https://github.com/CopterExpress/clover.git
synced 2026-05-26 11:43:25 +00:00
Add Dockerfile and Action for image for building the docs
This commit is contained in:
15
.github/workflows/docs-docker.yaml
vendored
Normal file
15
.github/workflows/docs-docker.yaml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Build docs Docker image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ '*' ]
|
||||
|
||||
jobs:
|
||||
docs-docker:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build Docker image
|
||||
run: docker build -t clover-docs:latest docs
|
||||
36
docs/Dockerfile
Normal file
36
docs/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# Build: sudo docker build -t clover-docs:latest .
|
||||
|
||||
# Run: docker run -it --rm -v ~/clover:/clover clover-docs:latest
|
||||
|
||||
# Save image: sudo docker save clover-docs:latest | gzip > clover-docs.tar.gz
|
||||
|
||||
FROM ubuntu:22.04
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y curl git
|
||||
|
||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
|
||||
RUN . $HOME/.nvm/nvm.sh && nvm install 10.15 && nvm use 10.15 && npm --version
|
||||
|
||||
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y calibre msttcorefonts ghostscript
|
||||
|
||||
RUN . $HOME/.nvm/nvm.sh && curl https://raw.githubusercontent.com/CopterExpress/clover/master/builder/assets/install_gitbook.sh | bash
|
||||
|
||||
# RUN . $HOME/.nvm/nvm.sh && npm install markdownlint-cli@0.28.1 -g && PUPPETEER_SKIP_DOWNLOAD=1 npm install svgexport -g
|
||||
RUN . $HOME/.nvm/nvm.sh && npm install markdownlint-cli@0.28.1 -g && npm install svgexport -g
|
||||
|
||||
RUN . $HOME/.nvm/nvm.sh && node -v && gitbook -V && markdownlint -V
|
||||
|
||||
RUN curl https://raw.githubusercontent.com/CopterExpress/clover/master/book.json > book.json
|
||||
|
||||
RUN . $HOME/.nvm/nvm.sh && gitbook install
|
||||
|
||||
CMD . $HOME/.nvm/nvm.sh && cp -r node_modules /clover && cd /clover && gitbook build \
|
||||
&& gitbook pdf ./ _book/clover.pdf && \
|
||||
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=_book/clover_ru_compressed.pdf _book/clover_ru.pdf && \
|
||||
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dNOPAUSE -dQUIET -dBATCH -dDetectDuplicateImages -dCompressFonts=true -r150 -sOutputFile=_book/clover_en_compressed.pdf _book/clover_en.pdf && \
|
||||
rm _book/clover_ru.pdf && mv _book/clover_ru_compressed.pdf _book/clover_ru.pdf && \
|
||||
rm _book/clover_en.pdf && mv _book/clover_en_compressed.pdf _book/clover_en.pdf
|
||||
Reference in New Issue
Block a user