Skip to content

Commit

Permalink
ci: added automated documentation deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Veer0x1 committed Dec 25, 2024
1 parent dacd839 commit c8e226e
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/update-doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: update documentation

on:
push:
branches:
- main
tags:
- v*

permissions:
contents: write

jobs:
deplou:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: |
cd doc-site
pip install -r requirements.txt
- name: Configure git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Deploy docs
run: |
cd doc-site
# Strip git ref prefix from version
echo "${{ github.ref }}"
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && ALIAS=$(echo $VERSION | sed -e 's/^v//')
# If building from main, use latest as ALIAS
[ "$VERSION" == "main" ] && ALIAS=latest
echo $VERSION $ALIAS
mike deploy --push --update-aliases $VERSION $ALIAS
mike set-default latest

0 comments on commit c8e226e

Please sign in to comment.