zzamboni / leanpub-orb

CircleCI orb for automating Leanpub book preview/publishing
https://circleci.com/orbs/registry/orb/zzamboni/leanpub
1 stars 1 forks source link
circleci circleci-orb circleci-orbs leanpub leanpub-api leanpub-orb orb

leanpub-orb

CircleCI orb for automating Leanpub book preview/publishing

Leanpub

Leanpub is a self-publishing service that supports ebooks and online courses. These can be written in Markdown or Markua and their builds and publishing automated using the bLeanpub API. After you register for a key, you can use the API with a webhook to trigger a build directly.

Workflow

My preferred workflow is outlined below; this can be directly triggered from git, saving time and effort:

Usage

To use, add a .circleci/config.yml file to your repo, containing the following code:

version: 2.1

orbs:
  leanpub: zzamboni/leanpub@0.2.4

# This tag-based book building workflow dispatches to the correct job
# depending on tagging
workflows:
  version: 2
  build-book:
    jobs:
      - leanpub/subset-preview:
          filters:
            tags:
              ignore:
                - /^preview.*/
                - /^publish.*/
                - /^silent-publish.*/
      - leanpub/full-preview:
          filters:
            tags:
              only: /^preview.*/
            branches:
              ignore: /.*/
      - leanpub/auto-publish:
          name: leanpub/silent-publish
          auto-release-notes: false
          filters:
            tags:
              only: /^silent-publish.*/
            branches:
              ignore: /.*/
      - leanpub/auto-publish:
          auto-release-notes: true
          filters:
            tags:
              only: /^publish.*/
            branches:
              ignore: /.*/

Ensure your repo name corresponds to your Leanpub book slug. If not, add a book-slug parameter to each job definition.

Next, enable CircleCI by:

You can find some additional descriptions and tips here: https://zzamboni.org/post/automating-leanpub-book-publishing-with-hammerspoon-and-circleci/