5
5
branches :
6
6
- ' main'
7
7
- ' stable-**'
8
- paths :
8
+ paths :
9
9
- ' ydb/docs/**'
10
10
workflow_dispatch :
11
11
@@ -19,11 +19,13 @@ jobs:
19
19
steps :
20
20
- name : Checkout
21
21
uses : actions/checkout@v4
22
+
22
23
- name : Build
23
24
uses : diplodoc-platform/docs-build-action@v3
24
25
with :
25
26
revision : " ${{ github.sha }}"
26
27
src-root : ${{ vars.SRC_ROOT }}
28
+
27
29
upload :
28
30
needs : build
29
31
runs-on : ubuntu-latest
@@ -41,30 +43,44 @@ jobs:
41
43
storage-access-key-id : ${{ secrets.DOCS_AWS_KEY_ID }}
42
44
storage-secret-access-key : ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
43
45
storage-region : ${{ vars.DOCS_AWS_REGION }}
46
+
44
47
release :
45
48
needs : upload
46
49
runs-on : ubuntu-latest
47
50
concurrency :
48
51
group : release-documentation-${{ github.ref }}
49
52
cancel-in-progress : true
50
53
steps :
51
- - name : Extract version
52
- shell : bash
53
- run : echo "version=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | sed -e 's|stable-|v|g' -e 's|-|.|g' >> $GITHUB_OUTPUT
54
+ - name : Extract version # turn branch name into version string
54
55
id : extract_version
55
- - name : Set update-only-version
56
+ shell : bash
57
+ run : |
58
+ echo "version=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" \
59
+ | sed -e 's|stable-|v|g' -e 's|-|.|g' \
60
+ >> $GITHUB_OUTPUT
61
+
62
+ - name : Get default branch name
63
+ id : get_default
64
+ run : |
65
+ default=$(curl -fsS \
66
+ https://raw.githubusercontent.com/ydb-platform/ydb/refs/heads/main/ydb/docs/default-branch.txt)
67
+ echo "DEFAULT_BRANCH=$default" >> $GITHUB_ENV
68
+
69
+ - name : Set update-only-version # only skip default-branch commits
56
70
id : set-update-only-version
57
71
run : |
58
- if [[ "${GITHUB_REF##*/}" == "main" ]]; then
72
+ current=${GITHUB_REF##*/} # e.g. 'main' or 'stable-X'
73
+ if [[ "$current" == "$DEFAULT_BRANCH" ]]; then
59
74
echo "update_only_version=false" >> $GITHUB_ENV
60
75
else
61
- echo "update_only_version=true" >> $GITHUB_ENV
76
+ echo "update_only_version=true" >> $GITHUB_ENV
62
77
fi
78
+
63
79
- name : Release
64
80
uses : diplodoc-platform/docs-release-action@v2
65
81
with :
66
82
revision : " ${{ github.sha }}"
67
- version : " ${{ steps.extract_version.outputs.version }}"
83
+ version : " ${{ steps.extract_version.outputs.version }}"
68
84
storage-bucket : ${{ secrets.DOCS_PROJECT_NAME }}
69
85
storage-access-key-id : ${{ secrets.DOCS_AWS_KEY_ID }}
70
86
storage-secret-access-key : ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
0 commit comments