-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (81 loc) · 2.1 KB
/
versionedDocs.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
name: Versioned Docs
on:
workflow_dispatch:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull') }}
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: "main"
path: main
- uses: actions/checkout@v3
with:
ref: docs
path: docs
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 17
- name: Generate docs
env:
STYTCH_PUBLIC_TOKEN: 'abc123'
GOOGLE_OAUTH_CLIENT_ID: 'abc123'
STYTCH_B2B_PUBLIC_TOKEN: 'abc123'
STYTCH_B2B_ORG_ID: 'abc123'
PASSKEYS_DOMAIN: 'abc123'
UI_GOOGLE_CLIENT_ID: 'abc123'
working-directory: main
run: ./gradlew dokkaHtmlMultiModule
- name: Zip docs site
run: |
cd main/docs
zip -r ../../Docs.zip .
cd -
- uses: actions/upload-artifact@v3
with:
name: "main"
path: Docs.zip
publish:
needs: [docs]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
path: main
- uses: actions/checkout@v3
with:
ref: docs
path: docs
- uses: actions/download-artifact@v3
with:
path: artifacts
- name: Unzip
run: |
mkdir unzipped-docs
unzipped_path="unzipped-docs/main"
mkdir -p "$unzipped_path"
unzip "artifacts/main/Docs.zip" -d "$unzipped_path"
echo "extracting to root"
rsync -a "$unzipped_path/" docs/docs
- name: Update git config
working-directory: docs
run: |
git config --local user.name "CI"
git config --local user.email "[email protected]"
- name: Commit
working-directory: main
run: |
current_sha="$(git rev-parse @)"
cd ../docs
if [[ -z $(git status --porcelain) ]]; then exit 0; fi
git add --all
git commit -m "$current_sha"
git push