-
Notifications
You must be signed in to change notification settings - Fork 34
[DOCS] Introduce per-repo docs build workflow #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sgolebiewski-intel
wants to merge
13
commits into
main
Choose a base branch
from
introducing-per-repo-docs-build-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+222
−34
Open
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2a5636e
[DOCS] Introduce per-repo docs build workflow
sgolebiewski-intel 56fd90e
Reorganize headings
sgolebiewski-intel 5ac2fa0
Applying suggestions
sgolebiewski-intel db922d6
Additional fixes
sgolebiewski-intel 8841998
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye b29b370
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye 6ec6d87
Prettier Write
dmytroye e628f73
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye cc48977
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye d298057
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye 33d3a30
Merge branch 'main' into introducing-per-repo-docs-build-workflow
dmytroye 1ad1b2c
Merge branch 'main' into introducing-per-repo-docs-build-workflow
sgolebiewski-intel 54e5e56
Update the docs-build workflow
sgolebiewski-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,189 @@ | ||
| --- | ||
| # SPDX-FileCopyrightText: (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: "Build Documentation" | ||
|
|
||
| inputs: | ||
| docs_directory: | ||
| description: >- | ||
| Documentation directory where the job will run, defaults to '.' | ||
| required: false | ||
| default: "." | ||
| type: string | ||
| output_directory: | ||
| description: >- | ||
| Directory where the documentation HTML build is located, | ||
| defaults to 'out/html' | ||
| required: false | ||
| default: "out/html" | ||
| type: string | ||
| branch_pattern: | ||
| description: >- | ||
| Regex pattern to match against when selecting branches to build for | ||
| version selector, defaults to '^(main|release-.*)$' | ||
| required: false | ||
| default: "^(main|release-.*)$" | ||
| type: string | ||
| simple_mode: | ||
| description: >- | ||
| When true, override configuration for simple documentation sites | ||
| required: false | ||
| default: true | ||
| type: boolean | ||
| orch_ci_repo_ref: | ||
| description: >- | ||
| The ref of the orch-ci repo, including bootstrap action and scripts, | ||
| defaults to 'main' | ||
| required: false | ||
| default: "main" | ||
| type: string | ||
| endpoint: | ||
| description: >- | ||
| Endpoint URL where documentation will be deployed to, | ||
| defaults to 's3://intel-openedgeplatform-documentation' | ||
| required: false | ||
| default: "s3://intel-openedgeplatform-documentation" | ||
| type: string | ||
| distribution_id: | ||
| description: >- | ||
| Distribution ID of documentation hosting service, | ||
| defaults to 'E1QN7TZJG8M0VL' | ||
| required: false | ||
| default: "E1QN7TZJG8M0VL" | ||
| type: string | ||
| exclude_patterns: | ||
| description: >- | ||
| Comma separated list of exclude patterns to use during the build, | ||
| defaults to empty list | ||
| required: false | ||
| default: "" | ||
| type: string | ||
| SYS_ORCH_GITHUB: | ||
| description: "PAT (contents: read) to clone private repos" | ||
| required: true | ||
| type: string | ||
| DOC_AWS_ACCESS_KEY_ID: | ||
| description: AWS access key for docs bucket | ||
| required: true | ||
| type: string | ||
| DOC_AWS_SECRET_ACCESS_KEY: | ||
| description: AWS secret access key for docs bucket | ||
| required: true | ||
| type: string | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Checkout action repository | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| repository: open-edge-platform/orch-ci | ||
| path: ci | ||
| ref: ${{ inputs.orch_ci_repo_ref }} | ||
| persist-credentials: false | ||
|
|
||
| - name: Bootstrap CI environment | ||
| uses: ./ci/.github/actions/bootstrap | ||
| with: | ||
| gh_token: ${{ inputs.SYS_ORCH_GITHUB }} | ||
| bootstrap_tools: "aws" | ||
|
|
||
| - name: Configure AWS credentials | ||
| uses: aws-actions/configure-aws-credentials@00943011d9042930efac3dcd3a170e4273319bc8 # v5.1.0 | ||
| with: | ||
| aws-access-key-id: ${{ inputs.DOC_AWS_ACCESS_KEY_ID }} | ||
| aws-secret-access-key: ${{ inputs.DOC_AWS_SECRET_ACCESS_KEY }} | ||
| aws-region: us-west-2 | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| # Fetch all history, otherwise sporadic issue with missing tags | ||
| fetch-depth: 0 | ||
| # Fetch tags | ||
| fetch-tags: true | ||
| # Checkout the branch that triggered the workflow | ||
| # to avoid detached HEAD | ||
| ref: ${{ github.head_ref }} | ||
| persist-credentials: false | ||
|
|
||
| # Fetch template from AWS S3 bucket | ||
| - name: Checkout template | ||
| if: ${{ inputs.simple_mode }} | ||
| env: | ||
| ENDPOINT: ${{ inputs.endpoint }} | ||
| shell: bash | ||
| run: | | ||
| mkdir -p "${GITHUB_WORKSPACE}"/_template | ||
| aws s3 cp --recursive "${ENDPOINT}/template" \ | ||
| "${GITHUB_WORKSPACE}"/_template | ||
|
|
||
| - name: Copy template | ||
| if: ${{ inputs.simple_mode }} | ||
| env: | ||
| DOCS_DIR: ${{ inputs.docs_directory }} | ||
| shell: bash | ||
| run: | | ||
| cd "${GITHUB_WORKSPACE}/${DOCS_DIR}" | ||
| # Override any existing files with template | ||
| cp -rf "${GITHUB_WORKSPACE}"/_template/* . | ||
| if [ -f "dictionary_append.txt" ]; then | ||
| cat "dictionary_append.txt" >> "dict.txt" | ||
| fi | ||
|
|
||
| - name: Add exclude patterns | ||
| env: | ||
| EXCLUDE: ${{ inputs.exclude_patterns }} | ||
| shell: bash | ||
| run: | | ||
| # Remove any spaces | ||
| exclude_no_spaces="${EXCLUDE// /}" | ||
| # Surround patterns with quotes and create Python list | ||
| exclude_pattern="[\"${exclude_no_spaces//,/\", \"}\"]" | ||
| conf_files=$(find "${GITHUB_WORKSPACE}" -type f -path "*/docs/conf.py") | ||
| for conf_file in $conf_files; do | ||
| echo "exclude_patterns.extend(${exclude_pattern})" >> "$conf_file" | ||
| done | ||
|
|
||
| - name: Install Spark theme | ||
| if: false # Disable step - Spark theme deprecated | ||
| env: | ||
| DOCS_DIR: ${{ inputs.docs_directory }} | ||
| ENDPOINT: ${{ inputs.endpoint }} | ||
| shell: bash | ||
| run: | | ||
| # Download Spark Sphinx theme | ||
| tmpdir="$(mktemp -d)" | ||
| aws s3 cp "${ENDPOINT}/theme/current" "${tmpdir}" | ||
| theme_wheel="$(cat "${tmpdir}/current")" | ||
| aws s3 cp "${ENDPOINT}/theme/${theme_wheel}" "${tmpdir}" | ||
| # Instantiate Python Virtual Environment | ||
| cd "${GITHUB_WORKSPACE}/${DOCS_DIR}" | ||
| make check | ||
| venv="$(find . -path '*/bin/activate' -name activate)" | ||
| # shellcheck source=/dev/null | ||
| source "${venv}" | ||
| # Install Spark Sphinx theme | ||
| pip3 install --no-input "${tmpdir}/${theme_wheel}" | ||
| deactivate | ||
|
|
||
| - name: Build Documentation | ||
| env: | ||
| DOCS_DIR: ${{ inputs.docs_directory }} | ||
| SIMPLE_MODE: ${{ inputs.simple_mode }} | ||
| shell: bash | ||
| run: | | ||
| cd "${GITHUB_WORKSPACE}/${DOCS_DIR}" | ||
| make build | ||
|
|
||
| # Checkout orch-ci again so the | ||
| # 'Post Bootstrap CI Environment' step does not fail | ||
| - name: Checkout action repository | ||
| if: always() | ||
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | ||
| with: | ||
| repository: open-edge-platform/orch-ci | ||
| path: ci | ||
| ref: ${{ inputs.orch_ci_repo_ref }} | ||
| persist-credentials: false |
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look on actionlint results and make required changes - Link
My suggestion is to specify runner and steps for each job to be able to reuse GHA action defined in actions/docs-build.
Here example how it should looks like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that not what we already have?
I think the problem is that the secrets syntax
${{ secrets.DOC_AWS_ACCESS_KEY_ID }}is somehow not allowed when calling GitHub Actions (not to be confused with GitHub Workflows).I'm thinking we should use environment variables via
env:to import the secrets. I'll propose some changes in a bit.