This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (86 loc) · 2.92 KB
/
deploy-documentation.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
name: Generate documentation and deploy on GH Pages
on:
push:
tags: '*'
branches-ignore:
- 'autodelivery**'
- 'bump-**'
- 'renovate/**'
paths-ignore:
- 'README.md'
- 'CHANGELOG.md'
- 'LICENSE'
pull_request:
workflow_dispatch:
jobs:
generate-doc:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: danysk/action-checkout@0.2.14
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Compute the version of Hugo
id: hugo
shell: bash
run: |
# Idea: the regex matcher of Renovate keeps this string up to date automatically
# The version is extracted and used to access the correct version of the scripts
USES=$(cat <<TRICK_RENOVATE
- uses: gohugoio/hugo@v0.122.0
TRICK_RENOVATE
)
echo "Scripts update line: \"$USES\""
echo "Computed version: \"${USES#*@v}\""
echo "::set-output name=version::${USES#*@v}"
- name: Download Hugo
run: |
HUGO_VERSION="${{ steps.hugo.outputs.version }}"
URL="https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
wget --retry-connrefused --waitretry=1 --read-timeout=20 "$URL" --output-document=hugo.deb
- name: Install Hugo
run: |
sudo dpkg -i hugo.deb
hugo version
rm hugo.deb
- name: Geneate Javadoc smart contracts
run : |
pushd smart-contracts
./gradlew javadoc
popd
ls -lah ./smart-contracts/build/javadoc/
mkdir -p ./public/smart-contracts && cp -r ./smart-contracts/build/javadoc/ ./public/smart-contracts/
- name: Generate Swagger UI for API server
uses: Legion2/swagger-ui-action@v1
with:
output: ./public/swagger-ui-api
spec-file: ./api-service/api/swagger.json
- name: Generate Swagger UI for AUTH server
uses: Legion2/swagger-ui-action@v1
with:
output: ./public/swagger-ui-auth
spec-file: ./api-service/auth/swagger.json
- name: Build slides with hugo
run: |
pushd docs/presentation
ls -la
hugo
popd
mkdir -p ./public/presentation && cp -r ./docs/presentation/public/* ./public/presentation/
- name: ls
run: |
ls -la ./public
ls -la ./public/presentation
ls -la ./public/smart-contracts/
ls -la ./public/swagger-ui-api
ls -la ./public/swagger-ui-auth
- name: Deploy auth docs to GitHub Pages
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: api-doc
publish_dir: ./public