Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
book-open

GitHub Action

ro-crate-preview

v1.2.0

ro-crate-preview

book-open

ro-crate-preview

This creates a preview html file from RO-Crate Metadata File (ro-crate-metadata.json)

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ro-crate-preview

uses: ResearchObject/ro-crate-preview-action@v1.2.0

Learn more about this action in ResearchObject/ro-crate-preview-action

Choose a version

Build HTML preview of RO-Crate

Overview

This action builds an html preview page from an RO Crate metadata file.

It can be used in conjunction with other GitHub actions in order to commit the files to your (e.g.) gh-pages branch, and then deploy to your github.io site.

Example workflow

  • Put your ro-crate-metadata.json in the root directory of your repo.

  • Create a file .github/workflows/ro-crate-to-ghpages.yml with the following contents:

    name: RO Crate to GitHub Pages
    on:
      push:
        branches:
          - master
    jobs:
      build-and-deploy:
        runs-on: ubuntu-22.04
        concurrency: ci-${{github.ref}}
        steps:
          - name: Checkout
            uses: actions/checkout@v3
    
          - name: Build RO Crate Preview
            uses: ResearchObject/ro-crate-preview-action@v1.1.0
    
          - name: Deploy
            uses: JamesIves/github-pages-deploy-action@v4
            with:
              folder: .
              branch: gh-pages

The action will run each time you push to the master branch.

The above workflow has steps to checkout your repo code, build ro-crate-preview.html, and commit this to the gh-pages branch.

If you have your GitHub repo settings to build a live site from your gh-pages branch, another GitHub action will automatically be triggered to render your preview at https://<username>.github.io/<repo>.