mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-03 14:03:52 +00:00
ci: add docs build to GHA (#897)
Restoring the docs build after we lost it with Travis. Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
parent
c8cd053b93
commit
77722acb25
91
.github/workflows/docs.yml
vendored
Normal file
91
.github/workflows/docs.yml
vendored
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
name: Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
apidocs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: mattnotmitt/doxygen-action@v1
|
||||||
|
with:
|
||||||
|
doxyfile-path: ./docs/Doxyfile
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: api-docs
|
||||||
|
path: html
|
||||||
|
|
||||||
|
gitbook:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: 16
|
||||||
|
|
||||||
|
- uses: awalsh128/cache-apt-pkgs-action@v1
|
||||||
|
with:
|
||||||
|
packages: calibre calibre-bin libxss1 libasound2
|
||||||
|
version: 1
|
||||||
|
|
||||||
|
- name: Install JS requirements
|
||||||
|
working-directory: book
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
|
||||||
|
- name: Build book
|
||||||
|
working-directory: book
|
||||||
|
run: |
|
||||||
|
npx gitbook build . public
|
||||||
|
npx gitbook pdf . public/cli11.pdf
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: gitbook
|
||||||
|
path: book/public
|
||||||
|
|
||||||
|
pages:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [apidocs, gitbook]
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
if: >
|
||||||
|
success()
|
||||||
|
&& github.ref == 'refs/heads/main'
|
||||||
|
&& github.repository == 'CLIUtils/CLI11'
|
||||||
|
steps:
|
||||||
|
- uses: actions/configure-pages@v3
|
||||||
|
id: pages
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: api-docs
|
||||||
|
path: _site
|
||||||
|
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: gitbook
|
||||||
|
path: _site/book
|
||||||
|
|
||||||
|
- uses: actions/upload-pages-artifact@v1
|
||||||
|
|
||||||
|
- uses: actions/deploy-pages@v2
|
||||||
|
id: deployment
|
14
book/package.json
Normal file
14
book/package.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "cli11-gitbook",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"dependencies": {
|
||||||
|
"gitbook-cli": "2.2.0",
|
||||||
|
"gitbook-plugin-hints": "^1.0.2",
|
||||||
|
"gitbook-plugin-include-codeblock": "^3.2.2",
|
||||||
|
"gitbook-plugin-term": "^0.5.1",
|
||||||
|
"svgexport": ">=0.4.2"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"postinstall": "npx gitbook fetch 3.2.3 && npx gitbook install"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user