Github Action


Use Calibre’s GitHub Action to automate CI/CD workflows with Calibre. The action is a wrapper around Calibre CLI, so you can run CLI commands as part of your build process.

Installation

Add a .github/workflows/calibre.yml file to your repository to install the action. See the action README for more information..

Example workflow: Create a deployment

  1. Create an API token for the Calibre API. Add the API Token to a GitHub Repository secret named CALIBRE_API_TOKEN.
  2. Obtain a Site slug identifier from Calibre by visiting Site → Settings → General. Add the Site slug to a GitHub Repository secret named CALIBRE_SITE_SLUG.
  3. Create a .github/workflows/calibre.yml workflow file:
1name: Create deploy marker in Calibre
2on:
3 push:
4 branches:
5 - main
6
7jobs:
8 build:
9 name: calibreapp/github-actions
10 runs-on: ubuntu-latest
11 steps:
12 - name: Create deploy
13 uses: calibreapp/github-actions@main
14 env:
15 CALIBRE_API_TOKEN: ${{ secrets.CALIBRE_API_TOKEN }}
16 with:
17 command: site create-deploy --site=${{ secrets.CALIBRE_SITE_SLUG }} --revision=${{ env.GITHUB_SHA }} --repository https://github.com/${{ env.GITHUB_REPOSITORY }}
18 - name: Get result
19 run: echo "${{steps.set-result.outputs.result}}"

Merges to the main branch will trigger the workflow and create a deploy marker in Calibre.