npm package: @narakeet/build-video-github-action
Description: GitHub Action to build videos from files in GitHub repositories using Narakeet
Author: Gojko Adzic
Latest version: 1.0.2

# Narakeet GitHub Action 

GitHub Action to build videos from files in GitHub repositories using [Narakeet](https://www.narakeet.com). 

Narakeet (formerly Video Puppet) allows you to create narrated videos quickly from markdown scripts and media assets, and edit videos as easily as editing plain text. It makes it easy to version control videos, include video building into continuous integration and generate video with multiple formats and languages from the same assets.

This action makes it easy to integrate Narakeet into GitHub continuous integration pipelines. For example, commit a new version of the app, take screenshots with Puppeteer, then update instructional videos automatically to reflect the latest version of the application.

Check out some nice [examples](https://github.com/narakeet/examples).

## Inputs

### `github-token`

**Required** The GitHub action Authentication Token to access the repository. Use `${{ secrets.GITHUB_TOKEN }}` to automatically set it to the token generated for the action

### `api-key`
   
**Required** Narakeet API Key for your account. To obtain a key, write to <contact@narakeet.com>. 

**Do not store the token directly in the action**. Instead, store it as an [encrypted secret](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets) to your repository, and then reference as `${{ secrets.SECRET_NAME }}`.

### `source-path`

**Required** Relative path to the main video script file (.md for markdown, .yaml for YAML and .json for JSON scripts); for example `hello-world/script/source.md`. Do not include the starting slash.

### `result-file`

**Optional** Local file system path for the result file; if you do not set this, the action will use the file name generated by Narakeet. You will be able to read out the resulting file in any case from the action outputs.

### `api-url`

**Optional** override for the API URL, used only for developers when testing; ignore this parameter unless you are developing this action.

## Outputs

### `video-file`

Resulting video file, ready for uploading to GitHub action artifacts or further processing.

### `video-url`

Temporary secure (signed) video URL - valid for 10 minutes - which can be used to download the video directly from Narakeet servers. 

## Example usage

The following workflow will generate a video using this action, then upload it to the [workflow artifacts](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/persisting-workflow-data-using-artifacts).

```
name: Make videos
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: narakeet/build-video-github-action@v1.0.2
      id: video
      with:
        source-path: hello-world/script/script.md
        github-token: ${{ secrets.GITHUB_TOKEN }}
        api-key: ${{ secrets.API_KEY }}
    - uses: actions/upload-artifact@v1
      with:
        name: video
        path: "${{ steps.video.outputs.video-file }}"
```

You will be able to access the generated video from the `Artifacts` menu in your GitHub Workflow

![](images/artifact.png)

## For developers and contributors

See [CONTRIBUTING.md](CONTRIBUTING.md).