-
Notifications
You must be signed in to change notification settings - Fork 507
41 lines (34 loc) · 1.25 KB
/
publish-release-docs.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
32
33
34
35
36
37
38
39
40
41
name: Publish release documentation
on:
push:
branches: ['master']
paths: ['documentation/release-latest/**']
jobs:
deploy:
runs-on: ubuntu-latest
if: github.repository == 'pinterest/ktlint'
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-depth: 0 # fetch all commits/branches
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install mkdocs and mike
run: pip install mkdocs-material mike
- name: Config git
run: |
git config user.email "[email protected]"
git config user.name "Ktlint Release Workflow"
- name: Get last released version
run: echo "version=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
- name: Deploy release docs
run: |
echo "Deploy release docs to version ${{ env.version }}"
cd documentation/release-latest
# Release docs are versioned so that user can use relevant docs for the ktlint version they use
mike deploy --push --update-aliases ${{ env.version }} latest
- name: Update default release docs
run: |
cd documentation/release-latest
mike set-default --push latest