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

fix: Workflow #96

Merged
merged 2 commits into from
Nov 24, 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
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
run: |
git config --global user.name "GitHub Actions Bot"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
poetry run mike deploy --push --force --message "Deployed by GitHub Actions" main
poetry run mike deploy --push --message "Deployed by GitHub Actions" main
45 changes: 45 additions & 0 deletions .github/workflows/publish-docs-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish MkDocs on Release

on:
release:
types:
- published

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install poetry
poetry install --with=docs

- name: Extract Major and Minor Version
run: |
VERSION_TAG=${{ github.event.release.tag_name }}
VERSION_TAG="${VERSION_TAG#v}" # Remove 'v' prefix if present
MAJOR="${VERSION_TAG%%.*}"
MINOR="${VERSION_TAG#*.}"
MINOR="${MINOR%%.*}"
MAJOR_MINOR_VERSION="${MAJOR}.${MINOR}"
echo "MAJOR_MINOR_VERSION=${MAJOR_MINOR_VERSION}" >> $GITHUB_ENV

- name: Deploy Updated Docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
poetry run mike deploy --push --message "Deploy docs for release ${{ github.event.release.tag_name }}" --update-alias $MAJOR_MINOR_VERSION latest
poetry run mike set-default --push latest
Loading