Skip to content

Commit e0c6a97

Browse files
authored
[stable-25-1] sync docs_release.yaml with main after #17623
1 parent 0c4f5a4 commit e0c6a97

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

.github/workflows/docs_release.yaml

+24-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- 'main'
77
- 'stable-**'
8-
paths:
8+
paths:
99
- 'ydb/docs/**'
1010
workflow_dispatch:
1111

@@ -19,11 +19,13 @@ jobs:
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v4
22+
2223
- name: Build
2324
uses: diplodoc-platform/docs-build-action@v3
2425
with:
2526
revision: "${{ github.sha }}"
2627
src-root: ${{ vars.SRC_ROOT }}
28+
2729
upload:
2830
needs: build
2931
runs-on: ubuntu-latest
@@ -41,30 +43,44 @@ jobs:
4143
storage-access-key-id: ${{ secrets.DOCS_AWS_KEY_ID }}
4244
storage-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
4345
storage-region: ${{ vars.DOCS_AWS_REGION }}
46+
4447
release:
4548
needs: upload
4649
runs-on: ubuntu-latest
4750
concurrency:
4851
group: release-documentation-${{ github.ref }}
4952
cancel-in-progress: true
5053
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
5455
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
5670
id: set-update-only-version
5771
run: |
58-
if [[ "${GITHUB_REF##*/}" == "main" ]]; then
72+
current=${GITHUB_REF##*/} # e.g. 'main' or 'stable-X'
73+
if [[ "$current" == "$DEFAULT_BRANCH" ]]; then
5974
echo "update_only_version=false" >> $GITHUB_ENV
6075
else
61-
echo "update_only_version=true" >> $GITHUB_ENV
76+
echo "update_only_version=true" >> $GITHUB_ENV
6277
fi
78+
6379
- name: Release
6480
uses: diplodoc-platform/docs-release-action@v2
6581
with:
6682
revision: "${{ github.sha }}"
67-
version: "${{ steps.extract_version.outputs.version }}"
83+
version: "${{ steps.extract_version.outputs.version }}"
6884
storage-bucket: ${{ secrets.DOCS_PROJECT_NAME }}
6985
storage-access-key-id: ${{ secrets.DOCS_AWS_KEY_ID }}
7086
storage-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}

0 commit comments

Comments
 (0)