name: Update docs pattern metadata
on:
push:
paths:
- "pattern-metadata.yaml"
- ".github/workflows/update-metadata.yml"
branches:
- main
jobs:
update-metadata:
uses: validatedpatterns/docs/.github/workflows/metadata-docs.yml@main
permissions:
contents: read
packages: write
id-token: write
secrets:
DOCS_TOKEN: ${{ secrets.DOCS_TOKEN }}Metadata and documentation
pattern-metadata.yaml feeds validatedpatterns.io cluster sizing pages through an automated sync workflow.
Keep the metadata file aligned with Hugo frontmatter on pattern landing pages so public website content and generated sizing tables stay consistent.
Use the following guidance to understand the sync process and enable automatic updates from your pattern repository.
How the documentation site uses metadata
When pattern-metadata.yaml changes in a pattern repository, an automated workflow can sync those values into this documentation repository.
A GitHub Actions workflow in the pattern repository runs when
pattern-metadata.yamlis updated on themainbranch.The workflow calls the reusable
metadata-docs.ymlworkflow from thevalidatedpatterns/docsrepository.The
utils/flatten_yaml.rbscript flattens the YAML structure into AsciiDoc attributes (preserving the source nesting, includingplatform).The workflow opens a pull request against
validatedpatterns/docsthat updatesmodules/<pattern-name>/metadata-<pattern-name>.adoc.Pattern cluster sizing pages include that generated module and the shared
modules/cluster-sizing-template.adoctemplate to render sizing tables.
Adding or updating |
Relationship to Hugo frontmatter
Pattern pages on validatedpatterns.io also use YAML frontmatter in content/patterns/<pattern-name>/_index.adoc (or _index.md).
That frontmatter drives the patterns browser, tier badges, and pattern landing pages on the public website.
It is separate from the catalog the Validated Patterns Operator UI consumes.
Keep both metadata sources aligned:
| Field | pattern-metadata.yaml | Hugo _index frontmatter |
|---|---|---|
Pattern name |
| Directory name, |
Tier |
|
|
Summary |
|
|
GitHub repository |
|
|
Documentation URL |
| Derived from pattern path |
CI dashboard |
|
|
Cluster sizing |
| Not stored in frontmatter; rendered from synced metadata module |
Enabling automatic sync to the documentation repository
To push metadata changes from your pattern repository into the docs repository, add a workflow that calls the shared metadata sync workflow.
Your pattern repository is hosted under the
validatedpatterns,validatedpatterns-sandbox, orvalidatedpatterns-demosGitHub organization.The Validated Patterns team has configured authentication for the docs repository (a
DOCS_TOKENsecret or the Validated Patterns Metadata Sync GitHub App).repo_urlinpattern-metadata.yamlmatches the GitHub URL of the pattern repository where the workflow runs.
Create
.github/workflows/update-metadata.ymlin your pattern repository.Commit and push
pattern-metadata.yamlto themainbranch.The workflow validates
repo_url, flattens the metadata, and opens a pull request in the docs repository.Review and merge the resulting pull request in
validatedpatterns/docs.
Contact validatedpatterns@googlegroups.com if you need help configuring repository secrets for metadata sync.
For sync failures, see Metadata sync workflow fails on repo URL in Validation and troubleshooting.
