Skip to content
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

Improve auto docs publishing #1905

Merged
merged 10 commits into from
Nov 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/workflows/docs_updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ jobs:
- name: Generate docs
run: |
poetry run bbot/scripts/docs.py
- name: Commit and Push Changes
run: |
git config user.name "BBOT Docs Autopublish"
git config user.email "[email protected]"
git checkout -b update-docs
git add "*.md" "docs/data/chord_graph/*.json"
git commit -m "Refresh module docs"
git push -u origin update-docs --force
env:
GITHUB_TOKEN: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
- name: Create or Update Pull Request
uses: peter-evans/create-pull-request@v7
with:
Expand All @@ -42,4 +32,3 @@ jobs:
base: dev
title: "Daily Docs Update"
body: "This is an automated pull request to update the documentation."
update-existing: true
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,49 @@ jobs:
repository: blacklanternsecurity/bbot
outputs:
BBOT_VERSION: ${{ steps.version.outputs.BBOT_VERSION }}
publish_docs:
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/stable' || github.ref == 'refs/heads/dev')
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.BBOT_DOCS_UPDATER_PAT }}
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Install dependencies
run: |
pip install poetry
poetry install --only=docs
- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch origin gh-pages:refs/remotes/origin/gh-pages
if git show-ref --verify --quiet refs/heads/gh-pages; then
git branch -f gh-pages origin/gh-pages
else
git branch --track gh-pages origin/gh-pages
fi
- name: Generate docs (stable branch)
if: github.ref == 'refs/heads/stable'
run: |
poetry run mike deploy Stable
- name: Generate docs (dev branch)
if: github.ref == 'refs/heads/dev'
run: |
poetry run mike deploy Dev
- name: Publish docs
run: |
git switch gh-pages
git push
# tag_commit:
# needs: publish_code
# runs-on: ubuntu-latest
Expand Down
Loading