Skip to content

Conversation

@PhilStollery
Copy link

Hi Merlin,

I was listening to Reconcilably Differentiated and thought, I might know how to do that. For my current work I use GitLab - but CI/CD pipelines seem similar.

This PR adds a GitHub action that on commit builds an epub. You should edit it to only run when a change to wisdom.md is made - and the epub is rubbish and missing content (but I think you know how to use pandoc to fix that).

But this is a bare bones start for you if you want to use it. Just something i could quickly do in 10 mins while I should be doing real work.

@philoserf
Copy link

A wee bit more idiomatic:

name: Publish Wisdom Book

run-name: ${{ github.actor }} is publishing a new wisdom book 📚

on:
  push:
    branches: [master]
    paths: [wisdom.md]

jobs:
  publish:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Pandoc
        run: sudo apt-get update && sudo apt-get install -y pandoc

      - name: Convert wisdom.md to EPUB
        run: |
          mkdir -p ebooks
          pandoc wisdom.md -o ebooks/wisdom.epub

      - name: Commit and push generated eBook
        uses: EndBug/add-and-commit@v9
        with:
          add: 'ebooks/wisdom.epub'
          message: 'Automated: Updated wisdom.epub'
          committer_name: GitHub Actions
          committer_email: actions@github.com

Comment on lines +1 to +3
name: GitHub Book Publisher
run-name: ${{ github.actor }} is publishing using GitHub Actions 🚀
on:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit, making it YAML compliant 😄

Suggested change
name: GitHub Book Publisher
run-name: ${{ github.actor }} is publishing using GitHub Actions 🚀
on:
---
name: GitHub Book Publisher
run-name: ${{ github.actor }} is publishing using GitHub Actions 🚀
"on":

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants