-
-
Notifications
You must be signed in to change notification settings - Fork 5
127 lines (122 loc) · 3.88 KB
/
GenerateDoc.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: Generate Docs 📄
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Make gradlew executable
run: chmod +x gradlew
- name: Decode google-services.json
env:
GOOGLE_SERVICES_JSON: ${{ secrets.APP_GOOGLE_JSON }}
run: echo $GOOGLE_SERVICES_JSON > ./bitapp/google-services.json
- name: Creating Local.Properties
env:
FIREBASE_WEB_CLIENT_ID: ${{ secrets.FIREBASE_WEB_CLIENT_ID }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
run: |
echo "firebaseWebClient=${FIREBASE_WEB_CLIENT_ID}" >> ./local.properties
echo "apiKey=${GEMINI_API_KEY}" >> ./local.properties
- name: Generate Dokka docs
run: ./gradlew dokkaHtmlMultiModule
- name: Upload Kt docs
uses: actions/upload-artifact@v2
with:
name: kt-docs
path: build/dokka
retention-days: 1
- name: Uploading mk-docs
uses: actions/upload-artifact@v2
with:
name: mk-docs
path: mk-docs
retention-days: 1
setting-up:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download docs
uses: actions/download-artifact@v3
with:
name: kt-docs
- name: Download MkDocs
uses: actions/download-artifact@v3
with:
name: mk-docs
- name: Copy docs
run: |
ls -la
mkdir -p copyDoc/generated
cp mkdocs.yml copyDoc/generated
mkdir -p copyDoc/generated/docs
cp -r docs/* copyDoc/generated/docs
ls -la copyDoc/generated/docs
mkdir -p copyDoc/generated/docs/app
cp -r htmlMultiModule/* copyDoc/generated/docs/app
ls -la copyDoc/generated/docs/app
- name: Upload docs
uses: actions/upload-artifact@v2
with:
name: generated-docs
path: copyDoc
retention-days: 1
deploy:
runs-on: ubuntu-latest
needs: setting-up
permissions: write-all
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- name: Download docs
uses: actions/download-artifact@v3
with:
name: generated-docs
- uses: joutvhu/get-release@v1
id: latest_release
with:
latest: true
pattern: 'v.+'
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
- uses: joutvhu/get-release@v1
id: pre_release
with:
latest: true
pattern: 'pre.+'
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.ACCOUNT_TOKEN }}
- run: |
cd generated
sed -i -E 's/stable.+/stable: ${{ steps.latest_release.outputs.tag_name }}/' mkdocs.yml
sed -i -E "s/pre_release.+/pre_release: $(echo ${{ steps.pre_release.outputs.tag_name }} | cut -c 13-) /" mkdocs.yml
echo "stable: ${{ github.event.inputs.stable }}"
echo "pre_release: ${{ github.event.inputs.pre_release }}"
pip install mkdocs-material
pip install mkdocs-glightbox
pip install mkdocs-markdownextradata-plugin
- run: |
cd generated
mkdocs gh-deploy --force