Skip to content

Commit

Permalink
Output directory
Browse files Browse the repository at this point in the history
  • Loading branch information
leonhfr committed Oct 2, 2022
1 parent 4a50fc8 commit 6f138c7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
uses: ./
with:
index: fixtures/index.json
output_dir: static/wasm
output_dir: public/wasm
output_types: |
wasm
js
Expand Down
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

tinysearch-action is a Github action to build a [tinysearch](https://github.com/tinysearch/tinysearch) engine from an index file. This action is meant to be combined with static site generators (Hugo, mdBook, ...).

This example takes a json index located in `public/index.json` and outputs all `wasm` and `js` files to the `static/wasm` directory.
This example takes a json index located in `public/index.json` and outputs all `wasm` and `js` files to the `public/wasm` directory.

```yaml
- name: Build tinysearch
uses: leonhfr/tinysearch-action@master
uses: leonhfr/tinysearch-action@v1
with:
index: public/index.json
output_dir: static/wasm
output_dir: public/wasm
output_types: |
wasm
js
Expand All @@ -20,15 +20,18 @@ This example takes a json index located in `public/index.json` and outputs all `
### Inputs
```yaml
- uses: leonhfr/tinysearch-action@master
- uses: leonhfr/tinysearch-action@v1
with:
# Path to the json index.
# Optional.
index: public/index.json # default
# Path to the output directory.
# If the directory does not exist, it will be created.
output_dir: static/wasm # default
# Required.
output_dir: public/wasm
# Extensions that will be copied from the tinysearch output to the output directory.
# This should be a multiline input using the pipe operator |, with one extension per line.
# Optional.
output_types: | # default
wasm
js
Expand Down Expand Up @@ -61,7 +64,9 @@ For example, the last step will echo file names:
- uses: actions/checkout@v3
- name: Build tinysearch
id: tinysearch
uses: leonhfr/tinysearch-action@master
uses: leonhfr/tinysearch-action@v1
with:
output_dir: public/wasm
- name: List emitted files
run: |
echo ${{ steps.tinysearch.outputs.files }}
Expand Down Expand Up @@ -109,9 +114,9 @@ Finally, use the action after building the hugo website and before publishing:
env:
HUGO_ENV: production
- name: Build tinysearch
uses: leonhfr/tinysearch-action@master
uses: leonhfr/tinysearch-action@v1
with:
output_dir: static/wasm
output_dir: public/wasm
output_types: |
wasm
- name: Deploy
Expand Down
4 changes: 2 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ inputs:
default: public/index.json
output_dir:
description: path to output directory
required: false
default: static/wasm
required: true
default: public/wasm
output_types:
description: file types to output
required: false
Expand Down

0 comments on commit 6f138c7

Please sign in to comment.