Skip to content

fix: flaky WorkflowAllFeatureIT.configMapNotReconciledIfReconcileCond… #482

fix: flaky WorkflowAllFeatureIT.configMapNotReconciledIfReconcileCond…

fix: flaky WorkflowAllFeatureIT.configMapNotReconciledIfReconcileCond… #482

Workflow file for this run

# Workflow for building and deploying a versioned Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
# Default to bash
defaults:
run:
shell: bash
jobs:
# Build job
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.155.3
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build test-index-processor and generate test documentation
run: |
./mvnw clean install -DskipTests
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
- name: Install Node.js dependencies
working-directory: ./docs
run: |
if [[ -f package-lock.json || -f npm-shrinkwrap.json ]]; then
npm ci
else
npm install --no-save autoprefixer postcss-cli postcss
fi
- name: Generate version dropdown
run: |
BASE_URL="${{ steps.pages.outputs.base_url }}"
BASE_PATH="$(echo "${BASE_URL}" | sed 's|https\?://[^/]*||')"
# Discover v5.x releases from git tags automatically.
VERSIONS=()
for minor in $(git tag --list 'v5.*.*' --sort=-version:refname \
| grep -E '^v5\.[0-9]+\.[0-9]+$' \
| sed 's/\.[0-9]*$//' | sort -Vru); do
latest=$(git tag --list "${minor}.*" --sort=-version:refname \
| grep -E '^v5\.[0-9]+\.[0-9]+$' | head -1)
VERSIONS+=("${latest}:${minor}")
done
echo "Discovered versions: ${VERSIONS[*]}"
# Generate version dropdown TOML (single source of truth for
# both the latest and all archived builds).
VERSIONS_TOML=$'\n# Version entries for the version selector dropdown.\n'
VERSIONS_TOML+=$'[[params.versions]]\n version = "latest"\n url = "'"${BASE_PATH}"'/"'$'\n'
for entry in "${VERSIONS[@]}"; do
TAG="${entry%%:*}"
LABEL="${entry##*:}"
VERSIONS_TOML+=$'\n[[params.versions]]\n'
VERSIONS_TOML+=" version = \"${TAG}\""$'\n'
VERSIONS_TOML+=" url = \"${BASE_PATH}/${LABEL}/\""$'\n'
done
# Persist for subsequent steps
echo "${VERSIONS_TOML}" >> docs/hugo.toml
printf '%s\n' "${VERSIONS[@]}" > /tmp/versions.txt
- name: Build latest docs
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
TZ: America/Los_Angeles
working-directory: ./docs
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Build versioned docs
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
TZ: America/Los_Angeles
run: |
BASE_URL="${{ steps.pages.outputs.base_url }}"
BASE_PATH="$(echo "${BASE_URL}" | sed 's|https\?://[^/]*||')"
# Read versions and TOML generated by the previous step
mapfile -t VERSIONS < /tmp/versions.txt
VERSIONS_TOML="$(sed -n '/^# Version entries/,$p' docs/hugo.toml)"
for entry in "${VERSIONS[@]}"; do
TAG="${entry%%:*}"
LABEL="${entry##*:}"
echo "::group::Building docs for ${LABEL} (from tag ${TAG})"
WORKDIR="/tmp/docs-${LABEL}"
mkdir -p "${WORKDIR}"
# Extract docs directory from the tagged version
git archive "${TAG}" -- docs/ | tar -x -C "${WORKDIR}"
# Copy node_modules for PostCSS (shared across all builds)
cp -r docs/node_modules "${WORKDIR}/docs/" 2>/dev/null || true
# Use current go.mod/go.sum so all builds use Docsy v0.14.3.
# Older tags used Docsy v0.11.0 which is incompatible with the
# Hugo version installed in CI (render hook naming changed).
cp docs/go.mod docs/go.sum "${WORKDIR}/docs/"
# Replace layouts and assets with the current version so that
# archived builds use compatible templates and consistent styling.
rm -rf "${WORKDIR}/docs/layouts"
cp -r docs/layouts "${WORKDIR}/docs/layouts"
rm -rf "${WORKDIR}/docs/assets"
cp -r docs/assets "${WORKDIR}/docs/assets"
# Patch hugo.toml for archived version
HUGO_TOML="${WORKDIR}/docs/hugo.toml"
sed -i 's/^version = .*/version = "'"${TAG}"'"/' "${HUGO_TOML}"
sed -i 's/^archived_version = .*/archived_version = true/' "${HUGO_TOML}"
# Remove any existing version dropdown entries so future tags
# that already contain [[params.versions]] do not get duplicates.
sed -i '/^\[\[params\.versions\]\]/,/^$/d' "${HUGO_TOML}"
# Append version dropdown entries
echo "${VERSIONS_TOML}" >> "${HUGO_TOML}"
# Build Hugo for this version.
# HUGO_ENABLEGITINFO=false because git archive extracts files
# without a .git directory, so git log would fail otherwise.
# Run from the source directory (not via --source) so that Go
# module resolution reads the correct go.mod.
(cd "${WORKDIR}/docs" && HUGO_ENABLEGITINFO=false hugo \
--gc \
--minify \
--baseURL "${BASE_URL}/${LABEL}/")
# Move output into the latest build's public directory as a subdirectory
mv "${WORKDIR}/docs/public" "docs/public/${LABEL}"
# Clean up
rm -rf "${WORKDIR}"
echo "::endgroup::"
done
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./docs/public
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5