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 c4e8870
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/automatic_doc_generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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: Import 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)
10 changes: 8 additions & 2 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,20 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

storybook-screenshots:
bot-updates:
steps:
name: Update storybook screenshots
permissions:
contents: write
secrets: inherit
uses: ./.github/workflows/storybook-visual.yml
with:
node-version: "20"
name: Generates Documentation
permissions:
contents: write
uses: ./.github/workflows/automatic_doc_generation.yml


build:
needs:
Expand Down Expand Up @@ -326,7 +332,7 @@ jobs:
- test-smoke
- 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 c4e8870

Please sign in to comment.