Skip to content

Commit

Permalink
ci: build docs on pr, combine workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
davidyuk committed Oct 16, 2024
1 parent 63b78b5 commit f6f00a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 35 deletions.
30 changes: 0 additions & 30 deletions .github/workflows/docs-develop.yml

This file was deleted.

21 changes: 16 additions & 5 deletions .github/workflows/docs-release.yml → .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Publish release docs
name: Build and publish docs
on:
pull_request:
push:
branches: [develop]
release:
types: [released]

jobs:
main:
runs-on: ubuntu-latest
Expand All @@ -12,7 +14,10 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: 3.x
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: ~/.cache/pip3
Expand All @@ -24,7 +29,13 @@ jobs:
~/.autorest
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
- run: pip3 install -r docs/requirements.txt
- run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action"
- run: mike deploy --push --update-aliases $RELEASE_VERSION latest
- if: github.event_name == 'pull_request'
run: mkdocs build
- if: github.event_name == 'push'
run: mike deploy --push develop
- if: github.event_name == 'release'
run: |
echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
mike deploy --push --update-aliases $RELEASE_VERSION latest

0 comments on commit f6f00a9

Please sign in to comment.