-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Update 'Vespa-CLI' reference documentation." (#3307)
* Revert "Update 'Vespa-CLI' reference documentation." This reverts commit 2339f04. * Revert "test workflows" This reverts commit efdb5cd. * Revert "fix(CI): push changes to the documentation with PR" This reverts commit b692efd.
- Loading branch information
Showing
24 changed files
with
128 additions
and
260 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,8 +9,10 @@ on: | |
schedule: | ||
- cron: "0 0 * * *" | ||
|
||
push: | ||
branches: [push-via-pr] # Test the workflow by pushing to this branch | ||
repository_dispatch: | ||
types: | ||
- update-vespa-version | ||
- update-vespa-cli-doc | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -22,20 +24,13 @@ defaults: | |
# Ref: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell | ||
shell: bash | ||
|
||
# Limit concurrency to better handle commit and push operations. | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
update-vespa-version: | ||
# | ||
# This job updates the Vespa version in the documentation. | ||
# | ||
runs-on: ubuntu-24.04 | ||
|
||
concurrency: | ||
group: docs-update | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -44,31 +39,33 @@ jobs: | |
sudo apt-get update | ||
sudo apt-get install -y xq | ||
- name: Update Vespa version | ||
id: update-docs | ||
- name: Get Latest Vespa version | ||
env: | ||
ENABLE_PUSH: ${{ contains(fromJSON('["workflow_dispatch", "schedule"]'), github.event_name) && github.ref_name == 'master' }} | ||
run: | | ||
VESPA_VERSION=$(curl -sSL https://repo1.maven.org/maven2/com/yahoo/vespa/parent/maven-metadata.xml | \ | ||
xq -x '/metadata/versioning/latest') | ||
echo "Vespa version: $VESPA_VERSION" | ||
echo "version=$VESPA_VERSION" >> $GITHUB_OUTPUT | ||
# Update the Vespa version in the documentation configuration file. | ||
sed -i'' "s/\(vespa_version:\) \"[0-9\.]*\"/\1 \"${VESPA_VERSION}\"/" _config.yml | ||
git diff | ||
echo "has-changes=$(git status --short | wc -l)" >> $GITHUB_OUTPUT | ||
- name: Commit changes | ||
if: ${{ steps.update-docs.outputs.has-changes != '0' }} | ||
uses: ./.github/actions/commit-updated-docs | ||
with: | ||
commit-message: "Update Vespa version to ${{ steps.vespa-metadata.outputs.version }}." | ||
files: _config.yml | ||
# push: ${{ env.ENABLE_PUSH == 'true' }} | ||
push: "true" | ||
# Check if there are changes to commit. | ||
if [[ -n "$(git status --porcelain)" ]]; then | ||
echo "Updating Vespa version in documentation to ${VESPA_VERSION}" >> $GITHUB_STEP_SUMMARY | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "${{ github.actor}}" | ||
git add _config.yml | ||
git commit -m "Update Vespa-version to ${VESPA_VERSION}. MERGEOK" | ||
git pull --rebase | ||
# Only push if the event is a push and the branch is the default branch. | ||
if [[ "${{ env.ENABLE_PUSH }}" == "true" ]]; then | ||
git push | ||
fi | ||
fi | ||
update-vespa-cli-doc: | ||
# | ||
|
@@ -80,17 +77,13 @@ jobs: | |
VESPA_CLI_DOC_DIR: en/reference/vespa-cli | ||
ENABLE_PUSH: ${{ contains(fromJSON('["workflow_dispatch", "schedule"]'), github.event_name) && github.ref_name == 'master' }} | ||
|
||
concurrency: | ||
group: docs-update | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Vespa CLI | ||
uses: vespa-engine/setup-vespa-cli-action@v1 | ||
|
||
- name: Generate Vespa CLI Documentation | ||
id: update-docs | ||
working-directory: ${{ env.VESPA_CLI_DOC_DIR }} | ||
run: | | ||
vespa gendoc . | ||
|
@@ -109,15 +102,21 @@ jobs: | |
sed -i'' 's#\(https://[a-z.]*vespa.ai/[^[:space:]]*\)#[\1](\1)#g' *.md | ||
git diff | ||
echo "has-changes=$(git status --short | wc -l)" >> $GITHUB_OUTPUT | ||
- name: Commit changes | ||
if: ${{ steps.update-docs.outputs.has-changes != '0' }} | ||
uses: ./.github/actions/commit-updated-docs | ||
with: | ||
commit-message: "Update 'Vespa-CLI' reference documentation." | ||
files: ${{ env.VESPA_CLI_DOC_DIR }} | ||
push: "true" | ||
# Check if there are changes to commit. | ||
if [[ -n "$(git status --short)" ]]; then | ||
echo "Updating Vespa CLI reference documentation" >> $GITHUB_STEP_SUMMARY | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "${{ github.actor}}" | ||
git add vespa*.md | ||
git commit -m "Update 'Vespa-CLI' reference documentation. MERGEOK" | ||
git pull --rebase | ||
if [[ "${{ env.ENABLE_PUSH }}" == "true" ]]; then | ||
git push | ||
fi | ||
fi | ||
update-metric-reference: | ||
# | ||
|
@@ -129,9 +128,6 @@ jobs: | |
env: | ||
ENABLE_PUSH: ${{ contains(fromJSON('["workflow_dispatch", "schedule"]'), github.event_name) && github.ref_name == 'master' }} | ||
|
||
concurrency: | ||
group: docs-update | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
@@ -152,8 +148,7 @@ jobs: | |
echo "Using version: $VESPA_VERSION" | ||
echo "version=$VESPA_VERSION" >> $GITHUB_OUTPUT | ||
- name: Update Metric Reference | ||
id: update-docs | ||
- name: Update to latest | ||
env: | ||
VESPA_VERSION: ${{ steps.vespa-metadata.outputs.version }} | ||
run: | | ||
|
@@ -162,10 +157,16 @@ jobs: | |
git diff | ||
- name: Commit changes | ||
if: ${{ steps.update-docs.outputs.has-changes != '0' }} | ||
uses: ./.github/actions/commit-updated-docs | ||
with: | ||
commit-message: "Update 'Metric' reference documentation." | ||
files: "en/reference/*-metrics-reference.html" | ||
push: "true" | ||
if [[ -n "$(git status --short en/reference/*-metrics-reference.html)" ]]; then | ||
echo "Updating metric reference" >> $GITHUB_STEP_SUMMARY | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "${{ github.actor}}" | ||
git add en/reference/*-metrics-reference.html | ||
git commit -m "Update 'Metric' reference documentation. MERGEOK" | ||
git pull --rebase | ||
if [[ "${{ env.ENABLE_PUSH }}" == "true" ]]; then | ||
git push | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.