Skip to contentSkip to conversation

github: add some basic GH Actions to build the notebook

PATCH In review Paul Moore 1 participant 2 messages Apr 4, 2022 SELinux security module

lore
Share & tools
lore

Paul Moore

author maintainer
#0 lore raw

PATCH 1/1 github: add some basic GH Actions to build the notebook

This patch adds GH Actions to built the HTML, PDF, and EPUB variants of The SELinux Notebook when the GH repo is updated or a pull request is submitted. This should make it much easier for people to validate their changes as well as providing fully rendered copies for each revision moving forward.

---
 .github/actions/setup/action.yml |   16 ++++++++++++++++
 .github/workflows/epub.yml       |   26 ++++++++++++++++++++++++++
 .github/workflows/html.yml       |   26 ++++++++++++++++++++++++++
 .github/workflows/pdf.yml        |   26 ++++++++++++++++++++++++++
 4 files changed, 94 insertions(+)
 create mode 100644 .github/actions/setup/action.yml
 create mode 100644 .github/workflows/epub.yml
 create mode 100644 .github/workflows/html.yml
 create mode 100644 .github/workflows/pdf.yml
.github/actions/setup/action.yml new file +16 -0
new file mode 100644
index 0000000..da37cf6
@@ -0,0 +1,16 @@
+#
+# Github Action to setup The SELinux Notebook build
+#
+# Copyright (c) 2022 Microsoft Corporation <[email protected]>
+# Author: Paul Moore <[email protected]>
+#
+
+name: Setup the build for The SELinux Notebook
+description: "Install dependencies for The SELinux Notebook build"
+runs:
+  using: "composite"
+  steps:
+  - run: sudo apt-get update
+    shell: bash
+  - run: sudo apt-get install -y build-essential weasyprint pandoc calibre
+    shell: bash
.github/workflows/epub.yml new file +26 -0
new file mode 100644
index 0000000..456f71d
@@ -0,0 +1,26 @@
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <[email protected]>
+# Author: Paul Moore <[email protected]>
+#
+
+name: EPUB build
+on: ["push", "pull_request"]
+
+jobs:
+  epub:
+    runs-on: ubuntu-20.04
+
+    steps:
+    - name: Checkout from GitHub
+      uses: actions/checkout@v2
+    - name: Setup the build directory
+      uses: ./.github/actions/setup
+    - name: Run the build
+      run: make epub
+    - name: Archive the rendering
+      uses: actions/upload-artifact@v3
+      with:
+        name: EPUB rendering
+        path: ./epub/SELinux_Notebook.azw3
.github/workflows/html.yml new file +26 -0
new file mode 100644
index 0000000..eeb9164
@@ -0,0 +1,26 @@
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <[email protected]>
+# Author: Paul Moore <[email protected]>
+#
+
+name: HTML build
+on: ["push", "pull_request"]
+
+jobs:
+  html:
+    runs-on: ubuntu-20.04
+
+    steps:
+    - name: Checkout from GitHub
+      uses: actions/checkout@v2
+    - name: Setup the build directory
+      uses: ./.github/actions/setup
+    - name: Run the build
+      run: make html
+    - name: Archive the rendering
+      uses: actions/upload-artifact@v3
+      with:
+        name: HTML rendering
+        path: ./html/SELinux_Notebook.html
.github/workflows/pdf.yml new file +26 -0
new file mode 100644
index 0000000..93ea28c
@@ -0,0 +1,26 @@
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <[email protected]>
+# Author: Paul Moore <[email protected]>
+#
+
+name: PDF build
+on: ["push", "pull_request"]
+
+jobs:
+  pdf:
+    runs-on: ubuntu-20.04
+
+    steps:
+    - name: Checkout from GitHub
+      uses: actions/checkout@v2
+    - name: Setup the build directory
+      uses: ./.github/actions/setup
+    - name: Run the build
+      run: make pdf
+    - name: Archive the rendering
+      uses: actions/upload-artifact@v3
+      with:
+        name: PDF rendering
+        path: ./pdf/SELinux_Notebook.pdf
author maintainer
#1 lore raw
Quoted 8 lines · Paul Moore

This patch adds GH Actions to built the HTML, PDF, and EPUB variants of The SELinux Notebook when the GH repo is updated or a pull request is submitted. This should make it much easier for people to validate their changes as well as providing fully rendered copies for each revision moving forward.

Quoted 10 lines
---
 .github/actions/setup/action.yml |   16 ++++++++++++++++
 .github/workflows/epub.yml       |   26 ++++++++++++++++++++++++++
 .github/workflows/html.yml       |   26 ++++++++++++++++++++++++++
 .github/workflows/pdf.yml        |   26 ++++++++++++++++++++++++++
 4 files changed, 94 insertions(+)
 create mode 100644 .github/actions/setup/action.yml
 create mode 100644 .github/workflows/epub.yml
 create mode 100644 .github/workflows/html.yml
 create mode 100644 .github/workflows/pdf.yml

Since this is more of a tooling patch and not a content patch I'm merging this now.

Signature · 1 line
paul-moore.com