-
Notifications
You must be signed in to change notification settings - Fork 27
77 lines (62 loc) · 1.92 KB
/
publish-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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Publish Docs
on:
push:
branches:
- main
# TODO: replace with on push tag https://github.com/actions/deploy-pages/issues/76
workflow_run:
workflows: [Publish Release]
types:
- completed
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'freeletics/flowredux'
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 19
- name: Install Android SDK
run: ./.github/android-sdk.sh
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install MkDocs Material
run: pip install mkdocs-material
- name: Build docs
# need to set the version name because for the default committed snapshot version
# dokkaHtml tasks get skipped
run: ./gradlew dokkaHtml -PVERSION_NAME=
- name: Copy docs
run: |
cp README.md docs/index.md
sed -i '/^\[\!\[GitHub release/d' docs/index.md
sed -i "s/<latest-version>/$(git describe --tags --abbrev=0)/" docs/index.md
cp CHANGELOG.md docs/changelog.md
mkdir -p docs/API/dsl
cp -R flowredux/build/dokka/html/. docs/API/dsl
mkdir -p docs/API/compose
cp -R compose/build/dokka/html/. docs/API/compose
- name: Build MkDocs
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: site
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2