-
Notifications
You must be signed in to change notification settings - Fork 6
31 lines (31 loc) · 926 Bytes
/
ci.yml
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
name: ci
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-material mike
- name: Set up git user
run: |
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
- name: Deploy MkDocs site
run: |
if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
git config pull.rebase true
git pull origin gh-pages
else
echo "gh-pages branch does not exist yet. Skipping pull."
fi
version=$(date +%Y.%m.%d-%H.%M)
mike deploy --push --update-aliases $version latest
mike set-default --push latest