mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-05 16:44:22 +00:00
Setup docs versioning
This commit is contained in:
75
.github/workflows/docs.yml
vendored
75
.github/workflows/docs.yml
vendored
@@ -14,9 +14,11 @@ on:
|
|||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
- 'mkdocs.yml'
|
- 'mkdocs.yml'
|
||||||
- 'docs-requirements.txt'
|
- 'docs-requirements.txt'
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: write
|
||||||
pages: write
|
pages: write
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
@@ -27,11 +29,12 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Needed for git-revision-date-localized plugin
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
@@ -46,20 +49,58 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdocs build --strict
|
mkdocs build --strict
|
||||||
|
|
||||||
- name: Upload documentation artifact
|
deploy-dev:
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: ./site
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
if: github.ref == 'refs/heads/main'
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: build
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy to GitHub Pages
|
- name: Checkout
|
||||||
id: deployment
|
uses: actions/checkout@v4
|
||||||
uses: actions/deploy-pages@v4
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -r docs-requirements.txt
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config --global user.name "${{ github.actor }}"
|
||||||
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Deploy development version
|
||||||
|
run: |
|
||||||
|
mike deploy --push --update-aliases dev latest
|
||||||
|
|
||||||
|
deploy-release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'release'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pip install -r docs-requirements.txt
|
||||||
|
|
||||||
|
- name: Configure Git
|
||||||
|
run: |
|
||||||
|
git config --global user.name "${{ github.actor }}"
|
||||||
|
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
|
||||||
|
|
||||||
|
- name: Deploy release version
|
||||||
|
run: |
|
||||||
|
VERSION=${GITHUB_REF#refs/tags/}
|
||||||
|
mike deploy --push --update-aliases $VERSION stable
|
||||||
|
mike set-default --push stable
|
||||||
|
|||||||
@@ -2,3 +2,4 @@ mkdocs-material==9.5.3
|
|||||||
mkdocs==1.5.3
|
mkdocs==1.5.3
|
||||||
pymdown-extensions==10.7
|
pymdown-extensions==10.7
|
||||||
mkdocs-git-revision-date-localized-plugin==1.2.4
|
mkdocs-git-revision-date-localized-plugin==1.2.4
|
||||||
|
mike==2.0.0
|
||||||
|
|||||||
@@ -61,8 +61,16 @@ nav:
|
|||||||
plugins:
|
plugins:
|
||||||
- search
|
- search
|
||||||
- git-revision-date-localized
|
- git-revision-date-localized
|
||||||
|
- mike:
|
||||||
|
version_selector: true
|
||||||
|
css_dir: css
|
||||||
|
javascript_dir: js
|
||||||
|
canonical_version: null
|
||||||
|
|
||||||
extra:
|
extra:
|
||||||
|
version:
|
||||||
|
provider: mike
|
||||||
|
default: stable
|
||||||
social:
|
social:
|
||||||
- icon: fontawesome/brands/github
|
- icon: fontawesome/brands/github
|
||||||
link: https://github.com/lordmathis/llamactl
|
link: https://github.com/lordmathis/llamactl
|
||||||
|
|||||||
Reference in New Issue
Block a user