Skip to content

Commit

Permalink
new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
esolitos authored and gitbutler-client committed Aug 12, 2024
1 parent 0fb6a1a commit 34c7ddc
Showing 1 changed file with 45 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Auto-update versions
name: Autoupdate Documentation
#
# Takes care of updating the Vespa version in the documentation.
# Takes care of updating the Vespa documentation.
#

on:
Expand All @@ -10,7 +10,12 @@ on:
- cron: "0 0 * * *"

repository_dispatch:
types: [update-vespa-version]
types:
- update-vespa-version
- update-vespa-cli-doc

push:
branches: [auto-update-versions] # Temporary branch to trigger the workflow

permissions:
contents: write
Expand All @@ -24,6 +29,9 @@ defaults:

jobs:
update-vespa-version:
#
# This job updates the Vespa version in the documentation.
#
runs-on: ubuntu-24.04

steps:
Expand Down Expand Up @@ -53,3 +61,37 @@ jobs:
git pull --rebase
git push
fi
update-vespa-cli-doc:
#
# This job updates the Vespa CLI documentation.
#
runs-on: ubuntu-latest

env:
VESPA_CLI_DOC_DIR: en/reference/vespa-cli

steps:
- uses: actions/checkout@v4

- name: Install Vespa CLI
uses: vespa-engine/setup-vespa-cli-action@v1

- name: Generate Vespa CLI Documentation
working-directory: ${{ env.VESPA_CLI_DOC_DIR }}
run: |
vespa gendoc .
# Update documentation markdown files with some metadata.
for f in $(git status --short . | awk '{print $2}'); do
title=$(echo $f | sed 's/\(vespa_\)?\(.*\)\.md/\2/')
(echo -e "---\ntitle: $title\nrender_with_liquid: false\n---\n"; cat ${f}) > ${f}.new
mv ${f}.new ${f};
done
# ensure linka are to .html
sed -i'' 's/\(vespa.*\).md)/\1.html)/' *.md
# create links
sed -i'' 's#\(https://[a-z.]*vespa.ai/[^[:space:]]*\)#[\1](\1)#g' *.md
git diff

0 comments on commit 34c7ddc

Please sign in to comment.