Skip to content

Commit

Permalink
feat(ci): introduce branch / tags-driven indexing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p committed Oct 16, 2024
1 parent 32b9545 commit 5d54657
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Index blueprints

on:
push:
branches:
- latest-stable
- develop
tags:
- v*

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
index-blueprints:
name: Index blueprints
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Extract version to index
id: extract-version
run: |
REF=${GITHUB_REF#refs/}
echo $REF
if [[ $REF == 'heads/latest-stable' ]]; then
echo "version=v$(curl -s https://api.kestra.io/v1/versions/latest | jq -r '.version')" >> $GITHUB_OUTPUT
elif [[ $REF == 'heads/develop' ]]; then
echo "version=v$(curl -s https://api.kestra.io/v1/versions/latest?snapshot=true | jq -r '.version')" >> $GITHUB_OUTPUT
elif [[ $REF == 'tags/v'* ]]; then
echo "version=${REF#tags/}" >> $GITHUB_OUTPUT
fi
- name: Blueprints indexing webhook for tag
id: trigger-index
run: |
echo ${{steps.extract-version.outputs.version}}
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"${{steps.vars.outputs.version}}\", \"to_index\": [\"blueprints\"]}" https://us.kestra.cloud/api/v1/kestra-tech/executions/webhook/product/indexing/${{ secrets.DOC_INDEXING_WEBHOOK }}

0 comments on commit 5d54657

Please sign in to comment.