Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions .github/scripts/release-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
Expand All @@ -19,7 +19,7 @@ set -xe
VERSION_NUMBER=$1 # (e.g. 0.1.0)
REPOSITORY="docs"

if [[ -z "$VERSION_NUMBER" ]]; then
if [[ -z "${VERSION_NUMBER}" ]]; then
echo "Error: VERSION_NUMBER is not set."
exit 1
fi
Expand All @@ -28,7 +28,7 @@ fi
VERSION="v${VERSION_NUMBER}"

# CHANNEL is the major and minor version of the VERSION_NUMBER (e.g. 0.1)
CHANNEL="$(echo $VERSION_NUMBER | cut -d '.' -f 1,2)"
CHANNEL="$(echo "${VERSION_NUMBER}" | cut -d '.' -f 1,2)"

# CHANNEL_VERSION is the version with the 'v' prefix (e.g. v0.1)
CHANNEL_VERSION="v${CHANNEL}"
Expand All @@ -44,24 +44,38 @@ pushd $REPOSITORY

git checkout -B "${CHANNEL_VERSION}"

# Replacements below are whitespace-, quote-, and comment-tolerant so they keep
# working even after `docs/config.toml` is reformatted.
# - `[[:space:]]*` around `=` tolerates any spacing (none, single, multiple).
# - `["\x27]` matches both double and single quotes.
# - Optional trailing `(#.*)?` allows an inline TOML comment on the line.
# - Each replacement re-emits the canonical taplo format: `key = "value"`.

# In docs/config.toml, change baseURL to https://docs.radapp.io/ instead of https://edge.docs.radapp.io/
awk '{gsub(/baseURL = \"https:\/\/edge\.docs\.radapp.io\/\"/,"baseURL = \"https:\/\/docs.radapp.io\/\""); print}' docs/config.toml > docs/config.toml.tmp
mv docs/config.toml.tmp docs/config.toml
sed -E -i 's|^[[:space:]]*baseURL[[:space:]]*=[[:space:]]*["\x27]https://edge\.docs\.radapp\.io/["\x27][[:space:]]*(#.*)?$|baseURL = "https://docs.radapp.io/"|' docs/config.toml

# In docs/config.toml, change version to VERSION instead of edge
VERSION_STRING_REPLACEMENT="version = \"${CHANNEL_VERSION}\""
awk -v REPLACEMENT="${VERSION_STRING_REPLACEMENT}" '{gsub(/version = \"edge\"/, REPLACEMENT); print}' docs/config.toml > docs/config.toml.tmp
mv docs/config.toml.tmp docs/config.toml
# In docs/config.toml, change version to CHANNEL_VERSION instead of edge
sed -E -i "s|^[[:space:]]*version[[:space:]]*=[[:space:]]*[\"\x27]edge[\"\x27][[:space:]]*(#.*)?$|version = \"${CHANNEL_VERSION}\"|" docs/config.toml

# In docs/config.toml, change github_branch to CHANNEL_VERSION instead of edge
GITHUB_BRANCH_STRING_REPLACEMENT="github_branch = \"${CHANNEL_VERSION}\""
awk -v REPLACEMENT="${GITHUB_BRANCH_STRING_REPLACEMENT}" '{gsub(/github_branch = \"edge\"/, REPLACEMENT); print}' docs/config.toml > docs/config.toml.tmp
mv docs/config.toml.tmp docs/config.toml
sed -E -i "s|^[[:space:]]*github_branch[[:space:]]*=[[:space:]]*[\"\x27]edge[\"\x27][[:space:]]*(#.*)?$|github_branch = \"${CHANNEL_VERSION}\"|" docs/config.toml

# In docs/config.toml, change chart_version (Helm chart) to VERSION_NUMBER
CHART_VERSION_STRING_REPLACEMENT="chart_version = \"${VERSION_NUMBER}\""
awk -v REPLACEMENT="${CHART_VERSION_STRING_REPLACEMENT}" '{gsub(/chart_version = \"[^\n]+\"/, REPLACEMENT); print}' docs/config.toml > docs/config.toml.tmp
mv docs/config.toml.tmp docs/config.toml
sed -E -i "s|^[[:space:]]*chart_version[[:space:]]*=[[:space:]]*[\"\x27][^\"\x27]+[\"\x27][[:space:]]*(#.*)?$|chart_version = \"${VERSION_NUMBER}\"|" docs/config.toml

# Verify all expected replacements happened; fail fast if config.toml drifted.
for pair in \
"baseURL|baseURL = \"https://docs.radapp.io/\"" \
"version-edge|version = \"${CHANNEL_VERSION}\"" \
"github_branch|github_branch = \"${CHANNEL_VERSION}\"" \
"chart_version|chart_version = \"${VERSION_NUMBER}\""; do
label="${pair%%|*}"
expected="${pair#*|}"
if ! grep -Fxq "${expected}" docs/config.toml; then
echo "Error: expected line for '${label}' not found in docs/config.toml: ${expected}"
exit 1
fi
done

# In docs/layouts/partials/hooks/body-end.html, change indexName to radapp-dev instead of radapp-dev-edge
awk '{gsub(/indexName: '\''radapp-dev-edge'\''/, "indexName: '\''radapp-dev'\''"); print}' docs/layouts/partials/hooks/body-end.html > docs/layouts/partials/hooks/body-end.html.tmp
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,29 @@ jobs:

- name: Configure git
run: |
git config --global user.email "${{ env.GITHUB_EMAIL }}"
git config --global user.name "${{ env.GITHUB_USER }}"
git config --global user.email "${GITHUB_EMAIL}"
Comment thread
willdavsmith marked this conversation as resolved.
git config --global user.name "${GITHUB_USER}"

- name: Ensure inputs.version is valid semver
run: |
python ./docs/.github/scripts/validate_semver.py ${{ inputs.version }}
python ./docs/.github/scripts/validate_semver.py "${INPUT_VERSION}"
env:
INPUT_VERSION: ${{ inputs.version }}

- name: Parse release channel
id: parse_release_channel
run: |
# CHANNEL is the major and minor version of the VERSION_NUMBER (e.g. 0.1)
CHANNEL="$(echo ${{ inputs.version }} | cut -d '.' -f 1,2)"
CHANNEL="$(echo ${INPUT_VERSION} | cut -d '.' -f 1,2)"
echo "channel=$CHANNEL" >> "${GITHUB_OUTPUT}"
env:
INPUT_VERSION: ${{ inputs.version }}

- name: Release docs
run: |
./docs/.github/scripts/release-docs.sh ${{ inputs.version }}
./docs/.github/scripts/release-docs.sh "${INPUT_VERSION}"
env:
INPUT_VERSION: ${{ inputs.version }}

- name: Change the default branch
run: |
Expand Down
53 changes: 35 additions & 18 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,12 @@ jobs:
# If a PR into edge, use 'edge'. If a PR into anywhere else, use 'latest'. If a push, use the branch name.
name: ${{ github.event_name == 'pull_request' && (github.base_ref == 'edge' && 'edge' || 'latest') || github.ref_name }}
env:
GOVER: "^1.17"
TUTORIAL_PATH: "./docs/content/user-guides/tutorials/"
CODE_ZIP_PATH: "./docs/static/tutorial/"
HUGO_ENV: production
steps:
- name: Checkout docs repo
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
fetch-depth: 0 # Required for enableGitInfo
persist-credentials: false

- name: Parse release version and set environment variables
Expand All @@ -63,20 +60,27 @@ jobs:
path: ./radius
persist-credentials: false

- name: Setup Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: docs/go.mod
cache: false

- name: Setup Node
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version-file: docs/.node-version
cache: npm
cache-dependency-path: docs/package-lock.json
node-version-file: .node-version

- name: Install root dependencies
- name: Install Node.js dependencies
working-directory: docs
run: npm ci --ignore-scripts
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || npm install"
Comment thread
willdavsmith marked this conversation as resolved.

- name: Install Docsy dependencies
working-directory: docs/themes/docsy
run: npm install --no-fund --no-audit
- name: Verify installations
working-directory: docs
run: |
echo "Go: $(go version)"
echo "Node.js: $(node --version)"
npm run hugo:version

- name: Generate Swagger docs
run: |
Expand All @@ -89,18 +93,31 @@ jobs:
# Within docs/config.toml, replace the line that starts with "github_branch" with "github_branch: $GITHUB_HEAD_REF"
sed -i "s|github_branch = .*|github_branch = \"$GITHUB_HEAD_REF\"|" docs/config.toml

- name: Restore Hugo cache
id: cache-restore
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ runner.temp }}/hugo_cache
key: hugo-${{ github.run_id }}
restore-keys: hugo-

- name: Build Hugo Site
working-directory: docs
run: |
if [ "${GITHUB_EVENT_NAME}" = 'pull_request' ]; then
STAGING_URL="https://${ENV_STATICWEBAPP_BASE}-pr${PR_NUMBER}.westus2.3.azurestaticapps.net/"
npm run build:preview -- -b "${STAGING_URL}"
else
npm run build
if [ "${GITHUB_EVENT_NAME}" == 'pull_request' ]; then
STAGING_URL="https://${ENV_STATICWEBAPP_BASE}-${GITHUB_EVENT_NUMBER}.westus2.3.azurestaticapps.net/"
fi
npm run build -- ${STAGING_URL+-b "$STAGING_URL"} --cacheDir "${RUNNER_TEMP}/hugo_cache"
env:
ENV_STATICWEBAPP_BASE: ${{ vars.ENV_STATICWEBAPP_BASE }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
RUNNER_TEMP: ${{ runner.temp }}

- name: Save Hugo cache
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ runner.temp }}/hugo_cache
key: ${{ steps.cache-restore.outputs.cache-primary-key }}

- name: Upload Hugo artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ docs/.hugo_build.lock
dictionary.dic
docs/static/swagger/**
.DS_STORE
docs/_vendor/
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
4 changes: 2 additions & 2 deletions docs/assets/scss/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
order: 1;

p, li, td {
font-weight: $font-weight-body-text;
font-weight: $font-weight-normal;
}

> h1 {
Expand Down Expand Up @@ -90,4 +90,4 @@
@include media-breakpoint-up(sm) {
font-size: 3rem;
}
}
}
12 changes: 7 additions & 5 deletions docs/assets/scss/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
background: $primary;
min-height: 4rem;
margin: 0;
padding: .5rem 1rem;
z-index: 32;

@include media-breakpoint-up(md) {
Expand Down Expand Up @@ -153,6 +154,7 @@ nav.foldable-nav {
}

ul.foldable {
display: block;
max-height: 0;
overflow: hidden;
transition: max-height 0.5s cubic-bezier(0, 1, 0, 1);
Expand All @@ -170,13 +172,13 @@ nav.foldable-nav {
padding-left: 1.3em;
}

.ul-1 .with-child > label:before {
.with-child > label:before {
display: inline-block;
font-style: normal;
font-variant: normal;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
font-family: "Font Awesome 5 Free"; font-weight: 900; content: "\f0da";
font-family: "Font Awesome 6 Free"; font-weight: 900; content: "\f0da";
position: absolute;
left: 0.1em;
padding-left: 0.4em;
Expand All @@ -189,7 +191,7 @@ nav.foldable-nav {
}
}

.ul-1 .with-child > input:checked ~ label:before {
.with-child > input:checked ~ label:before {
color: $primary;
transform: rotate(90deg);
transition: transform 0.5s;
Expand All @@ -202,13 +204,13 @@ nav.foldable-nav {

nav.foldable-nav {

.ul-1 .with-child > label:hover:before {
.with-child > label:hover:before {
color: $primary;
transform: rotate(30deg);
transition: transform 0.5s;
}

.ul-1 .with-child > input:checked ~ label:hover:before {
.with-child > input:checked ~ label:hover:before {
color: $primary;
transform: rotate(60deg) !important;
transition: transform 0.5s;
Expand Down
20 changes: 13 additions & 7 deletions docs/assets/scss/_sidebar-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

&__section-title {
display: block;
font-weight: $font-weight-medium;
font-weight: $font-weight-normal;

.active {
font-weight: $font-weight-bold;
Expand Down Expand Up @@ -98,20 +98,26 @@
}

.td-sidebar-link.tree-root{
font-weight: $font-weight-bold;
color: $td-sidebar-tree-root-color;
border-bottom: 1px $td-sidebar-tree-root-color solid;
font-weight: $font-weight-normal;
color: $gray-900;
border-bottom: 1px $gray-900 solid;
margin-bottom: 1rem;
margin-top: 1rem;
}

.td-sidebar-link.tree-root.active,
.td-sidebar-link.tree-root .active {
font-weight: $font-weight-bold;
}
}

.td-sidebar {
@include media-breakpoint-up(md) {
margin-top: 0;
padding-top: 4rem;
background-color: $td-sidebar-bg-color;
background-color: $gray-100;
padding-right: 1rem;
border-right: 1px solid $td-sidebar-border-color;
border-right: 1px solid $gray-300;
}


Expand All @@ -137,7 +143,7 @@
position: sticky;
top: 4rem;
z-index: 10;
height: calc(100vh - 6rem);
height: calc(100vh - 4rem);
}
}

Expand Down
29 changes: 28 additions & 1 deletion docs/assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@import "nav";
@import "sidebar-tree";
@import "content";

.td-navbar .navbar-brand__name {
display: none;
}
Expand All @@ -10,4 +14,27 @@

.btn {
border-radius: 10px;
}
}

.td-content .alert-primary {
background-color: #ffffff;
color: inherit;
border-color: #c43821;
}


.cardpane-matrix {
display: grid;
grid-template-columns: 1fr;
gap: 1.5rem;

@include media-breakpoint-up(lg) {
grid-template-columns: repeat(2, 1fr);
}

> .td-card {
margin: 0 !important;
min-width: 0;
height: 100%;
}
}
Loading
Loading