castedo / baseprinter-action

Basecast Build Pages Action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Baseprinter Action

This is a reusable automation workflow for GitHub Actions that generates HTML/PDF previews of Baseprint document snapshots using Baseprinter.

Inputs

The defaults-file input parameter is required. It specifies the path to a Pandoc defaults file, which can specify the input source files.

Quick Start

To quickly get started, use baseprint-starter as a template to create a new repository.

Alternatively, add a workflow file to an existing repository. Use baseprint-starter .github/workflows/baseprinter.yaml or the following example.

Example Usage

The following is an example of a workflow YAML file that you can place at .github/workflows/baseprinter.yaml. This workflow will generate a Baseprint document snapshot and deploy an HTML/PDF preview to GitHub Pages.

name: Deploy Baseprint preview to GitHub Pages

on:
  push:
    branches: [main]

  # Enables manual workflow runs from the Actions tab
  workflow_dispatch:

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# and committing generated baseprint snapshot to autobaseprint branch
permissions:
  contents: write
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: castedo/baseprinter-action@v5
        with:
          defaults-file: "pandocin.yaml"
  deploy:
    needs: build
    runs-on: ubuntu-22.04
    steps:
      - name: "Deploy to GitHub Pages"
        id: deployment
        uses: actions/deploy-pages@v2
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}

About

Basecast Build Pages Action

License:MIT License