Add an in-memory data store (#7950) #10
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: Generate reference docs | |
on: | |
workflow_dispatch: | |
inputs: | |
open_pull_request: | |
description: 'Open a pull request against the docs repository. Defaults to false for a "dry run" of the workflow that generates the docs and uploads them as artifacts.' | |
required: false | |
default: "false" | |
type: choice | |
options: | |
- "true" | |
- "false" | |
push: | |
branches: | |
- main | |
- release/* | |
pull_request: | |
branches: | |
- main | |
jobs: | |
reference-docs: | |
name: Generate and PR reference documentation | |
runs-on: ubuntu-latest | |
if: github.repository == 'radius-project/radius' | |
env: | |
GOVER: "1.22.2" | |
GOPRIVATE: github.com/radius-project | |
steps: | |
- name: Checkout radius repository | |
uses: actions/checkout@v4 | |
with: | |
repository: radius-project/radius | |
path: radius | |
- name: Parse release version and set environment variables | |
run: python radius/.github/scripts/get_release_version.py | |
- name: Generate docs release branch name | |
run: | | |
if [[ ${{ env.REL_CHANNEL }} != "edge" ]]; then | |
echo DOCS_BRANCH="v${{ env.REL_CHANNEL }}" >> $GITHUB_ENV | |
else | |
echo DOCS_BRANCH="edge" >> $GITHUB_ENV | |
fi | |
- name: Checkout docs repository | |
uses: actions/checkout@v4 | |
with: | |
repository: radius-project/docs | |
path: docs | |
ref: ${{ env.DOCS_BRANCH }} | |
# Setup dependencies | |
- name: Set up Go ${{ env.GOVER }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GOVER }} | |
cache-dependency-path: radius/go.sum | |
- name: Setup NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- name: Install TypeSpec compiler | |
run: | | |
pushd radius/typespec | |
npm ci | |
popd | |
- name: Install autorest | |
run: npm install -g autorest@3.7.1 | |
- name: Install oav | |
run: npm install -g oav@3.3.5 | |
- name: Install mockgen | |
run: | | |
cd radius | |
go install go.uber.org/mock/mockgen@v0.4.0 | |
- name: Install controller-gen | |
run: | | |
cd radius | |
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.15.0 | |
# Generate Bicep docs | |
- name: Generate Bicep docs | |
run: | | |
cd radius | |
make generate | |
# Generate resource reference docs | |
- name: Generate resource reference docs | |
run: python docs/.github/scripts/generate_resource_references.py ./radius/hack/bicep-types-radius/generated/ ./docs/docs/content/reference/resources | |
- name: Upload resource reference docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: resource-docs | |
path: docs/docs/content/reference/resources | |
# Generate and upload CLI docs | |
- name: Generate CLI docs | |
run: | | |
find docs/docs/content/reference/cli -type f ! -name '_index.md' -delete | |
cd radius | |
go run cmd/docgen/main.go ../docs/docs/content/reference/cli | |
- name: Upload CLI docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cli-docs | |
path: docs/docs/content/reference/cli | |
# Open PR against docs repository | |
- name: Show git diff | |
run: | | |
cd docs | |
git status --porcelain -unormal -- *.md | |
- name: Create pull request | |
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.open_pull_request == 'true') | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GH_RAD_CI_BOT_PAT }} | |
path: docs | |
add-paths: | | |
*.md | |
committer: rad-ci-bot <rad-ci-bot@users.noreply.github.com> | |
author: rad-ci-bot <rad-ci-bot@users.noreply.github.com> | |
signoff: true | |
branch: reference-cli/patch-${{ github.sha }} | |
delete-branch: true | |
title: | | |
Update auto-generated documentation | |
body: | | |
## Autogenerated PR | |
This PR updates the auto-generated reference documentation. | |
GitHub SHA: ${{ github.sha }} | |
commit-message: | | |
Autogenerate reference docs |