Skip to content

Commit c6bcde6

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 e8a2dd7 commit c6bcde6

File tree

8 files changed

+100
-10
lines changed

8 files changed

+100
-10
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Node rules:
2+
## Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
3+
.grunt
4+
5+
## Dependency directory
6+
## Commenting this out is preferred by some people, see
7+
## https://docs.npmjs.com/misc/faq#should-i-check-my-node_modules-folder-into-git
8+
/node_modules
9+
10+
# Book build output
11+
/_book
12+
13+
# eBook build output
14+
/book.epub
15+
/book.mobi
16+
/book.pdf

book.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
{
2-
"variables" : {
3-
"draft" : "yes",
4-
"title" : "Getting Started with UEFI HTTPS Boot on EDK II",
5-
"version" : "Revision 1.30"
6-
},
7-
8-
"plugins": ["puml"],
9-
"pluginsConfig": {}
10-
}
1+
{
2+
"variables" : {
3+
"draft" : "yes",
4+
"title" : "Getting Started with UEFI HTTPS Boot on EDK II",
5+
"version" : "Revision 1.30"
6+
},
7+
8+
"plugins": ["puml-aleung"],
9+
"pluginsConfig": {}
10+
}

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)