Skip to content

Build a flipbook with flip-forge from a PDF as a static webpage

License

Notifications You must be signed in to change notification settings

flip-forge/build-flip-forge

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build-flip-forge

Build a static page with flip-forge from a PDF. Current only works on ubuntu workflows.

Example usage

- name: build-flip-forge
  id: build
  uses: flip-forge/build-flip-forge@v1
  with:
    # REQUIRED! Path to the PDF file that will be converted to a flipbook
    file: "book.pdf"

    # Meta title used as the HTML page title:
    title: "Flipbook with flip-forge"

    # Background color of the generated web page
    backgroundColor: "#000000"

    # Toolbar color used in the generate web page
    toolbarColor: "#ffffff"

    # Meta description used in the generated web pages
    description: "Flipbook description"

Outputs

  • dist points to the dist folder with the generated static files. Example usage for GitHub pages:
    - name: build-flip-forge
      id: build
      uses: flip-forge/build-flip-forge@v1
      with:
        file: "book.pdf"
    - name: Upload artifact
      uses: actions/upload-pages-artifact@v3
      with:
        path: ${{ steps.build.outputs.dist }}
    - name: Deploy to GitHub Pages
      id: deployment
      uses: actions/deploy-pages@v4

Development

Requirements:

  • node (>=20)
  • poppler-utils

Steps to setup the project for developing/contributing:

  1. Clone repo
  2. Install dependencies
    npm install
  3. Create a local build:
    • you can use either the sample PDF from the repo
      npm run build-test
    • or use your own PDF
      npx tsx build/cli.ts --writeEnv "path/to/your/pdf-file.pdf"
  4. Run dev server
    npm run dev

Run tests

To run tests, you must first create the default test build:

npm run build-test

Running options:

  • Open interactive Cypress test runner and manually run specs from there
    npm run test:e2e:dev
  • To run the full suite headless:
    npm run test:e2e
  • To run a single spec headless
    npm run test:e2e -- -s cypress/e2e/book.cy.ts