-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1905 from blacklanternsecurity/fix-docs-autopublish
Improve auto docs publishing
- Loading branch information
Showing
2 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -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: | ||
|
@@ -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 |
This file contains 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 |
---|---|---|
|
@@ -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 | ||
|