Skip to content

Commit

Permalink
ci: add auto updates of docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hetangmodi-crest committed Jul 31, 2024
1 parent fd0e8b1 commit cd48a8c
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/automatic_doc_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "Automatic doc generation"
on:
pull_request:
branches:
- main
- develop

jobs:
generate-docs:
runs-on: ubuntu-latest
env:
isPR: ${{ github.event.pull_request.base.ref == 'develop' || github.event.pull_request.base.ref == 'main' }}
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Generate docs
run: |
python splunk_add_on_ucc_framework/generators/doc_generator.py
- name: Importing GPG key
if: ${{ env.isPR }}
uses: crazy-max/ghaction-import-gpg@v6
with:
git_committer_name: ${{ secrets.SA_GH_USER_NAME }}
git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }}
gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.SA_GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
- name: Push updated screenshots
if: ${{ env.isPR }}
run: |
git add \*.md
git diff --staged --exit-code || (git commit -S -m "doc: updated docs regarding generated conf, xml and html files" && git push)
8 changes: 8 additions & 0 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ jobs:
with:
node-version: "20"

bot-updates:
name: Generates Documentation
permissions:
contents: write
uses: ./.github/workflows/automatic_doc_generation.yml


build:
needs:
- fossa-scan
Expand Down Expand Up @@ -327,6 +334,7 @@ jobs:
- test-ui
- build-test-addon-openapi-client
- storybook-screenshots
- bot-updates
runs-on: ubuntu-latest
env:
NEEDS: ${{ toJson(needs) }}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_server_conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import tempfile

from splunk_add_on_ucc_framework import server_conf as server_conf_lib
from splunk_add_on_ucc_framework import server_conf as server_conf_lib # type: ignore[attr-defined]
from tests.unit import helpers


Expand Down

0 comments on commit cd48a8c

Please sign in to comment.