-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (46 loc) · 1.66 KB
/
Copy pathdocs.yml
File metadata and controls
48 lines (46 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Publish docs
on:
release:
types: ["created"]
workflow_dispatch:
inputs:
version:
description: "Version to deploy. Leave empty to redeploy the latest release tag."
required: false
type: string
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # fetch all commits/branches (otherwise "mike deploy" fails)
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.13
cache: "pip"
- run: pip install -r requirements.txt
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: uv-3.13-${{ hashFiles('uv.lock') }}
- run: uv sync --frozen
- name: git config for "mike deploy"
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
- name: deploy docs by mike
run: |
if [ "${{ github.event_name }}" = "release" ]; then
VERSION="${{ github.event.release.tag_name }}"
else
VERSION="${{ github.event.inputs.version }}"
if [ -z "$VERSION" ]; then
VERSION=$(git describe --tags --abbrev=0)
fi
fi
VERSION=$(uv run python scripts/convert_to_pep440_version.py "$VERSION")
uv run mike deploy "$VERSION" latest --update-aliases --push --force
uv run mike set-default latest --push