Skip to content

Commit

Permalink
+ uptrieve.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Jul 25, 2024
1 parent 48ab11d commit 4c8bbce
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/uptrieve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Index docs with Trieve

on:
workflow_call:
secrets:
api_key:
description: "Trieve API token"
required: true
dataset:
description: "Trieve dataset ID"
required: true
inputs:
path:
required: false
type: string
default: "./docs"
latest_version:
required: false
type: string
default: ""
jobs:
uptrieve:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
- name: Install uptriever
run: |
gem install uptriever
- if: ${{ !contains(github.ref, 'refs/tags/v') }}
name: Index edge documents
run: |
uptriever -d ${{inputs.path}} -k ${{secrets.api_key}} -s ${{secrets.dataset}}
- if: ${{ contains(github.ref, 'refs/tags/v') }}
id: version
run: |
echo ::set-output name=VERSION_TAG::$(echo ${GITHUB_REF#refs/tags/} | cut -d'.' -f1,2)
echo ::set-output name=VERSION_PREFIX::$(echo ${GITHUB_REF#refs/tags/} | awk -F. '{print $1 "-" $2}')
- if: ${{ contains(github.ref, 'refs/tags/v') }}
env:
VERSION_TAG: ${{ steps.version.outputs.VERSION_TAG }}
VERSION_PREFIX: ${{ steps.version.outputs.VERSION_PREFIX }}
run: |
uptriever -d ${{inputs.path}} -k ${{secrets.api_key}} -s ${{secrets.dataset}}
- if: ${{ contains(github.ref, 'refs/tags/v') && steps.version.outputs.VERSION_TAG == inputs.latest_version }}
uses: anycable/github-actions/.github/workflows/uptrieve.yml@master
env:
VERSION_TAG: latest
VERSION_PREFIX: ""
run: |
uptriever -d ${{inputs.path}} -k ${{secrets.api_key}} -s ${{secrets.dataset}}

0 comments on commit 4c8bbce

Please sign in to comment.