diff mbox series

github: add some basic GH Actions to build the notebook

Message ID 164911024356.258070.13216631741313822218.stgit@olly (mailing list archive)
State Accepted
Delegated to: Paul Moore
Headers show
Series github: add some basic GH Actions to build the notebook | expand

Commit Message

Paul Moore April 4, 2022, 10:10 p.m. UTC
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.

Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 .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
diff mbox series

Patch

diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
new file mode 100644
index 0000000..da37cf6
--- /dev/null
+++ b/.github/actions/setup/action.yml
@@ -0,0 +1,16 @@ 
+#
+# Github Action to setup The SELinux Notebook build
+#
+# Copyright (c) 2022 Microsoft Corporation <paulmoore@microsoft.com>
+# Author: Paul Moore <paul@paul-moore.com>
+#
+
+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
diff --git a/.github/workflows/epub.yml b/.github/workflows/epub.yml
new file mode 100644
index 0000000..456f71d
--- /dev/null
+++ b/.github/workflows/epub.yml
@@ -0,0 +1,26 @@ 
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <paulmoore@microsoft.com>
+# Author: Paul Moore <paul@paul-moore.com>
+#
+
+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
diff --git a/.github/workflows/html.yml b/.github/workflows/html.yml
new file mode 100644
index 0000000..eeb9164
--- /dev/null
+++ b/.github/workflows/html.yml
@@ -0,0 +1,26 @@ 
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <paulmoore@microsoft.com>
+# Author: Paul Moore <paul@paul-moore.com>
+#
+
+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
diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml
new file mode 100644
index 0000000..93ea28c
--- /dev/null
+++ b/.github/workflows/pdf.yml
@@ -0,0 +1,26 @@ 
+#
+# Github Action to build The SELinux Notebook
+#
+# Copyright (c) 2022 Microsoft Corporation <paulmoore@microsoft.com>
+# Author: Paul Moore <paul@paul-moore.com>
+#
+
+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