Skip to content

Commit 27ebe9c

Browse files
committed
Add Gitbook Action to publish HTML, PDF, EPUB, and MOBI
Add Gitbook Action to publish this document in the gh-pages branch of the same repository in HTML, PDF, EPUB, and MOBI formats. The draft and release versions of the documents are published in different directories of the gh-pages branch so all published versions are available for download and online viewing. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <[email protected]> Reviewed-by: Kevin Shaw <kevin.w.shaw@intel> Acked-by: Laszlo Ersek <[email protected]>
1 parent afecb20 commit 27ebe9c

File tree

8 files changed

+80
-7
lines changed

8 files changed

+80
-7
lines changed

.bookignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/.github
2+
.gitignore
3+
.bookignore

.github/workflows/gitbook-action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Gitbook Action Build'
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- release/*
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout action
14+
uses: actions/checkout@v2
15+
- name: Get Branch
16+
run: |
17+
raw=$(git branch -r --contains ${{ github.ref }})
18+
branch=${raw/ origin\/}
19+
pubdir=${branch/master/draft}
20+
pubdir=${pubdir////-}
21+
echo "ON_PUSH_BRANCH_NAME=$branch" >> $GITHUB_ENV
22+
echo "ON_PUSH_PUBDIR=$pubdir" >> $GITHUB_ENV
23+
- name: Gitbook Action
24+
uses: zanderzhao/[email protected]
25+
with:
26+
token: ${{secrets.GITBOOK_ACTION_PERSONAL_TOKEN}}
27+
source_branch: ${{env.ON_PUSH_BRANCH_NAME}}
28+
publish_branch: gh-pages
29+
publish_dir: ${{env.ON_PUSH_PUBDIR}}
30+
publish_remove_last_build: true
31+
gitbook_pdf: true
32+
gitbook_pdf_dir: /
33+
gitbook_pdf_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
34+
gitbook_epub: true
35+
gitbook_epub_dir: /
36+
gitbook_epub_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}
37+
gitbook_mobi: true
38+
gitbook_mobi_dir: /
39+
gitbook_mobi_name: ${{ github.event.repository.name }}-${{env.ON_PUSH_PUBDIR}}

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
## Dependency directory
66
## Commenting this out is preferred by some people, see
77
## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
8-
node_modules
8+
/node_modules
99

1010
# Book build output
11-
_book
11+
/_book
1212

1313
# eBook build output
14-
*.epub
15-
*.mobi
16-
*.pdf
14+
/book.epub
15+
/book.mobi
16+
/book.pdf

book.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"title" : "EDK II Module Writer's Guide",
55
"version" : "Revision 0.71"
66
},
7-
8-
"plugins": ["puml"],
7+
"plugins": ["puml-aleung"],
98
"pluginsConfig": {}
109
}

styles/epub.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
p {
2+
font-family: sans, sans-serif, Arial;
3+
}
4+
5+
body {
6+
font-family: sans, sans-serif, Arial;
7+
}
8+
19
h1 {
210
color: #0860A8;
311
font-weight: normal;

styles/mobi.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
p {
2+
font-family: sans, sans-serif, Arial;
3+
}
4+
5+
body {
6+
font-family: sans, sans-serif, Arial;
7+
}
8+
19
h1 {
210
color: #0860A8;
311
font-weight: bold;

styles/pdf.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
p {
2+
font-family: sans, sans-serif, Arial;
3+
}
4+
5+
body {
6+
font-family: sans, sans-serif, Arial;
7+
}
8+
19
h1 {
210
color: #0860A8;
311
font-weight: normal;

styles/website.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
p {
2+
font-family: sans, sans-serif, Arial;
3+
}
4+
5+
body {
6+
font-family: sans, sans-serif, Arial;
7+
}
8+
19
h1 {
210
color: #0860A8;
311
font-weight: normal;

0 commit comments

Comments
 (0)