Docs #157
Workflow file for this run
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
name: Docs | |
on: | |
schedule: | |
- cron: '0 9 * * 1' | |
workflow_dispatch: | |
inputs: | |
version-number: | |
type: string | |
description: What is the new version number (ex. v0.28.0) for the website? If updating dev, leave this blank. | |
default: master | |
required: false | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout DJL Repo | |
uses: actions/checkout@v4 | |
- name: Update versions.json | |
env: | |
NEW_VERSION: '${{ github.event.inputs.version-number }}' | |
run: | | |
echo "The version number is $NEW_VERSION" | |
DUPLICATE=$(jq --arg v "$NEW_VERSION" 'any(.version == $v)' versions.json) | |
if [ "$DUPLICATE" = "true" ]; then | |
echo "Version $NEW_VERSION already exists. Skipping update." | |
echo "duplicate=true" >> $GITHUB_OUTPUT | |
else | |
jq --arg v "$NEW_VERSION" '([{"version": $v, "title": $v, "aliases": []}] + .)' versions.json > temp.json && mv temp.json versions.json | |
echo "duplicate=false" >> $GITHUB_OUTPUT | |
fi | |
- name: Upload versions.json as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: versions-json | |
path: versions.json | |
if-no-files-found: error | |