Skip to content

Commit

Permalink
Merge pull request redhat-openshift-ecosystem#3871 from redhat-opensh…
Browse files Browse the repository at this point in the history
…ift-ecosystem/ISV-4399

Publish documentation to Github pages
  • Loading branch information
Allda authored Jan 15, 2024
2 parents 2b99d93 + 6e6c55b commit 9479b56
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 31 deletions.
38 changes: 11 additions & 27 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,43 +1,27 @@
name: "Documentation"
# This workflow is outdated and needs to be replaced with a one that
# uses the new documntation location.

on:
schedule:
- cron: "0 0 * * *"
push:
paths:
- docs/**
- mkdocs.yml
- README.md
branches:
- main
workflow_dispatch:
inputs:
number-of-prs:
description: 'Number of PRs'
required: true
default: '100'

env:
OPP_THIS_REPO: "redhat-openshift-ecosystem/community-operators-prod"

jobs:
documentation:
runs-on: ubuntu-latest
container: quay.io/operator_testing/community-operators-mkdocs
steps:
- uses: actions/checkout@v3
with:
repository: redhat-openshift-ecosystem/community-operators-pipeline
ref: documentation

- name: Generate docs
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPR: ${{ github.event.inputs.number-of-prs || 100 }}
run: |
OPP_THIS_REPO_SED="https://github.com/$OPP_THIS_REPO"
OPP_THIS_REPO_SED=${OPP_THIS_REPO_SED//\//\\/}
sed -i 's/repo_url.*/repo_url: '$OPP_THIS_REPO_SED'/g' mkdocs.yml
sed -i 's/ cluster_type:.*/ cluster_type: ocp/g' mkdocs.yml
pip install mkdocs mkdocs-material pymdown-extensions
cat mkdocs.yml
ci/operator-flow/doc.sh ${NPR} ${OPP_THIS_REPO}
# Replace relatives links from root folder to docs folder
# - remove docs/ from links
sed -i -e "s/(docs\//(/g" README.md
mkdocs build
- name: Deploy
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@

This repo is the canonical source for Kubernetes Operators that appear on [OpenShift Container Platform](https://openshift.com) and [OKD](https://www.okd.io/).

**NOTE** The index catalog `registry.redhat.io/redhat/redhat-operator-index:v<OCP Version>` is built from this repository and it is
**NOTE** The index catalog `registry.redhat.io/redhat/community-operator-index:v<OCP Version>` is built from this repository and it is
consumed by Openshift and OKD to create their sources and built their catalog. To know more about how
Openshift catalog are built see the [documentation](https://docs.openshift.com/container-platform/4.6/operators/understanding/olm-rh-catalogs.html#olm-rh-catalogs_olm-rh-catalogs).
Openshift catalog are built see the [documentation](https://docs.openshift.com/container-platform/4.14/operators/understanding/olm-rh-catalogs.html#olm-rh-catalogs_olm-rh-catalogs).

See our [documentation](https://redhat-openshift-ecosystem.github.io/community-operators-prod/) to find out more about Community operators and contribution.

## Add your Operator

Expand All @@ -20,7 +22,6 @@ If you have an existing Operator read our contribution guidelines on how to [pac
- [Prerequisites](docs/contributing-prerequisites.md)
- [Where to place operator](docs/contributing-where-to.md)
- [Creating pull request (PR)](docs/contributing-via-pr.md)
- [Accepted Bundle Format](docs/accepted_bundle_formats.md)
- [Operator Publishing / Review settings](docs/operator-ci-yaml.md)
- [OKD/OpenShift Catalogs criteria and options](docs/packaging-required-criteria-ocp.md)

Expand Down
1 change: 1 addition & 0 deletions docs/README.md
2 changes: 1 addition & 1 deletion docs/operator-ci-yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you want to accelerate publishing your changes, consider adding yourself and
If an author of PR is not in `reviewers` list or not in `ci.yaml` on `main` branch, PR will not be merged automatically.

> **Note:**
If an auhor of PR is not in `reviewers` list and `reviewers` are present in `ci.yaml` file. All `reviewers` will be mentioned in PR comment to check for upcoming changes.
If an author of PR is not in `reviewers` list and `reviewers` are present in `ci.yaml` file. All `reviewers` will be mentioned in PR comment to check for upcoming changes.

For this to work, it is required to setup reviewers in `ci.yaml` file. It can be done by adding `reviewers` tag with a list of GitHub usernames. For example

Expand Down
27 changes: 27 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
site_name: Community operators
repo_name: community-operators
repo_url: https://github.com/redhat-openshift-ecosystem/community-operators-prod
nav:
- "Overview": README.md
- "Packaging your Operator for OperatorHub":
- "Operator structure": packaging-operator.md
- "Required fields": packaging-required-fields.md
- "Contributing":
- "Prerequisites": contributing-prerequisites.md
- "Where to place operator": contributing-where-to.md
- "Creating pull request (PR)": contributing-via-pr.md
- "Operator Publishing / Review settings": operator-ci-yaml.md
- "OKD/OpenShift Catalogs criteria and options": packaging-required-criteria-ocp.md
- "Operator pipeline": community-operator-pipeline.md
- "Best practices": best-practices.md

theme:
name: material
features:
- navigation.tabs
- navigation.sections
- navigation.expand
- toc.integrate

plugins:
- search

0 comments on commit 9479b56

Please sign in to comment.