@@ -33,26 +33,27 @@ jobs:
33
33
steps :
34
34
- uses : actions/checkout@v4
35
35
- uses : ./.github/actions/install-python
36
- - name : Create the virtual env
37
- run : |
38
- python -m venv ~/env_rs_doc
39
- working-directory : .
40
- shell : bash
41
- - uses : ./.github/actions/poetry-install
42
- with :
43
- options : --no-root
44
- venv : ~/env_rs_doc
45
- working-directory : .
36
+
46
37
- name : Clone RS-Server/RS-Client/RS-Demo/RS-Infra/RS-Helm
47
38
run : |
48
39
set -x
49
40
pwd
50
41
ls -all
51
42
cd docs
52
43
44
+ # We want to use the same branch name (if it exists) in the other
45
+ # cloned repositories than the current branch name
46
+ branch_name=${{ github.ref_name }}
47
+
48
+ #
53
49
# Clone public rspy repositories
54
- git clone -b develop https://github.com/RS-PYTHON/rs-server.git
55
- git clone -b develop https://github.com/RS-PYTHON/rs-client-libraries.git
50
+
51
+ git clone https://github.com/RS-PYTHON/rs-server.git
52
+ (cd rs-server; git checkout $branch_name || git checkout develop)
53
+
54
+ git clone https://github.com/RS-PYTHON/rs-client-libraries.git
55
+ (cd rs-client-libraries; git checkout $branch_name || git checkout develop)
56
+
56
57
ls -all
57
58
58
59
# Clone private rspy repositories.
@@ -63,12 +64,14 @@ jobs:
63
64
# https://github.com/RS-PYTHON/rs-helm/settings/keys
64
65
eval "$(ssh-agent -s)"
65
66
ssh-add - <<< "${{ secrets.RS_DEMO_PRIVATE_SSH_KEY }}"
66
- git clone -b develop [email protected] :RS-PYTHON/rs-demo.git
67
+ git clone [email protected] :RS-PYTHON/rs-demo.git
68
+ (cd rs-demo; git checkout $branch_name || git checkout develop)
67
69
68
70
eval "$(ssh-agent -s)"
69
71
ssh-add - <<< "${{ secrets.RS_INFRA_PRIVATE_SSH_KEY }}"
70
- git clone -b develop - -depth 1 [email protected] :RS-PYTHON/rs-infrastructure.git
72
+ git clone --depth 1 [email protected] :RS-PYTHON/rs-infrastructure.git
71
73
cd rs-infrastructure
74
+ git checkout $branch_name || git checkout develop
72
75
git sparse-checkout init --no-cone
73
76
echo "/docs/" > .git/info/sparse-checkout
74
77
echo "/LICENSE" >> .git/info/sparse-checkout
@@ -80,61 +83,20 @@ jobs:
80
83
81
84
eval "$(ssh-agent -s)"
82
85
ssh-add - <<< "${{ secrets.RS_HELM_PRIVATE_SSH_KEY }}"
83
- git clone -b develop [email protected] :RS-PYTHON/rs-helm.git
86
+ git clone [email protected] :RS-PYTHON/rs-helm.git
87
+ (cd rs-helm; git checkout $branch_name || git checkout develop)
84
88
working-directory : .
85
- shell : bash
86
- # # The technical documentation uses a dedicated python project to be built
87
- # - uses: ./.github/actions/poetry-install
88
- # with:
89
- # working-directory: ./docs/rs-server/
90
-
91
- # To pull ghcr.io/rs-python/apikey-manager
92
- # TODO: to be changed when the apikey manager will have its own container registry.
93
- - name : Log into Docker registry
94
- uses : docker/login-action@v3
95
- with :
96
- registry : ghcr.io
97
- username : ${{ github.actor }}
98
- password : ${{ secrets.GITHUB_TOKEN }}
99
-
100
- - name : Generate REST API (Swagger) HTML documentation
101
- run : |
102
- set -x
103
- pwd
104
- ls -all
105
- sleep 2
106
- cd docs/rs-server/
107
- # Generate the aggregated openapi.json/swagger
108
- echo 'Generate the aggregated openapi.json/swagger'
109
- ./services/frontend/resources/build_aggregated_openapi.sh --run-services --set-version
110
-
111
- # Copy it beside the index.html
112
- echo 'Copy openapi.json in rest directory'
113
- cp ./services/frontend/resources/openapi.json ./docs/doc/api/rest/
114
89
shell : bash
115
90
116
- # - name: Deploy docs to ghpages
117
- # uses: peaceiris/actions-gh-pages@v4
118
- # with:
119
- # github_token: ${{ secrets.GITHUB_TOKEN }}
120
- # publish_branch: gh-pages
121
- # publish_dir: ./site
122
-
123
- - uses : ./.github/actions/poetry-install
124
- with :
125
- venv : ~/env_rs_doc
126
- working-directory : ./docs/rs-server
127
- - uses : ./.github/actions/poetry-install
128
- with :
129
- venv : ~/env_rs_doc
130
- working-directory : ./docs/rs-client-libraries
91
+ - name : Install dependencies
92
+ uses : ./.github/actions/poetry-install
93
+
131
94
- name : Generate Markdown HTML documentation
132
95
run : |
133
96
set -x
134
97
pwd
135
98
ls -all
136
99
sleep 2
137
- source ~/env_rs_doc/bin/activate
138
100
poetry run mkdocs gh-deploy --force
139
101
working-directory : .
140
102
shell : bash
0 commit comments