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@xxxxxxxxxxxxxx> --- .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 --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@xxxxxxxxxxxxx> +# Author: Paul Moore <paul@xxxxxxxxxxxxxx> +# + +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@xxxxxxxxxxxxx> +# Author: Paul Moore <paul@xxxxxxxxxxxxxx> +# + +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@xxxxxxxxxxxxx> +# Author: Paul Moore <paul@xxxxxxxxxxxxxx> +# + +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@xxxxxxxxxxxxx> +# Author: Paul Moore <paul@xxxxxxxxxxxxxx> +# + +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