-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (53 loc) · 1.76 KB
/
generate-docs-site.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
name: Deploy Reference Documentation
on:
workflow_dispatch:
inputs:
version:
description: 'SDK Version'
required: true
type: string
permissions:
id-token: write
jobs:
deploy-reference-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '21'
- name: Configure Git
run: |
git config --global user.email "[email protected]"
git config --global user.name "eg-oss-ci"
- name: Checkout gh-pages branch
run: |
git fetch origin mdwairi/refactor-docs-versioning
git checkout mdwairi/refactor-docs-versioning
- name: List directories in gh-pages (debug step)
run: |
echo "Directories in gh-pages branch:"
ls -d */
- name: Move latest release to the older directory
run: |
VERSION=$(jq -r '.version' version.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
rsync -av --exclude='older' --exclude='.git' --exclude='README.md' --remove-source-files ./ older/$VERSION/
find . -type d -empty -delete
mkdir -p ${{ runner.temp }}/older
mv older/* ${{ runner.temp }}/older
- name: list older content before checkout
run: ls ${{ runner.temp }}/older
- name: Checkout to main
run: git checkout main
- name: move old versions to code
run: |
mv ${{ runner.temp }}/older code/older
ls code/older
- name: Whats in code dir
run: ls code
- name: Generate new docs
run: mvn -f code dokka:dokka
- name: list new content
run: cat code/target/dokka/version.json