-
Notifications
You must be signed in to change notification settings - Fork 87
33 lines (31 loc) · 1.24 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Index doc on tag
on:
push:
branches:
- main
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
index-doc:
name: Index doc
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Extract version to index
id: extract-version
run: |
REF=${GITHUB_REF#refs/}
if [[ $REF == 'heads/main' ]]; then
echo "version=v$(curl -s https://api.kestra.io/v1/versions/latest | jq -r '.version')" >> $GITHUB_OUTPUT
echo "snapshot_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: Doc indexing webhook for tag
id: trigger-index
run: |
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"${{steps.extract-version.outputs.version}}\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}
curl -X POST -H "Content-Type: application/json" -d "{\"tag\": \"${{steps.extract-version.outputs.snapshot_version}}\", \"to_index\": [\"docs\"]}" ${{ secrets.DOC_INDEXING_WEBHOOK }}