Skip to content

Commit 3750573

Browse files
committed
Publish docs to s3 uses current version of workflows/scripts
In case we built docs for past version of airflow we checkout both - current (main) version of code to use latest environment and tag version of code to build the documentation. The workflow mixed sub-workflows and run them from the "tag" version of workflow rather than from current. This PR fixes it.
1 parent 4377a8d commit 3750573

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

.github/workflows/publish-docs-to-s3.yml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ jobs:
182182
with:
183183
persist-credentials: false
184184
path: current-version
185+
- name: "Free up disk space"
186+
shell: bash
187+
run: ./current-version/scripts/tools/free_up_disk_space.sh
188+
- name: "Make /mnt writeable"
189+
run: ./current-version/scripts/ci/make_mnt_writeable.sh
190+
- name: "Move docker to /mnt"
191+
run: ./current-version/scripts/ci/move_docker_to_mnt.sh
185192
# We are checking repo for both - breeze and docs from the ref provided as input
186193
# This will take longer as we need to rebuild CI image and it will not use cache
187194
# but it will build the CI image from the version of Airflow that is used to check out things
@@ -192,13 +199,6 @@ jobs:
192199
ref: ${{ inputs.ref }}
193200
fetch-depth: 0
194201
fetch-tags: true
195-
- name: "Free up disk space"
196-
shell: bash
197-
run: ./scripts/tools/free_up_disk_space.sh
198-
- name: "Make /mnt writeable"
199-
run: ./scripts/ci/make_mnt_writeable.sh
200-
- name: "Move docker to /mnt"
201-
run: ./scripts/ci/move_docker_to_mnt.sh
202202
- name: "Apply patch commits if provided"
203203
run: |
204204
if [[ "${APPLY_COMMITS}" != "" ]]; then
@@ -242,24 +242,29 @@ jobs:
242242
INCLUDE_COMMITS: ${{ startsWith(inputs.ref, 'providers') && 'true' || 'false' }}
243243
run: >
244244
breeze build-docs ${INCLUDE_DOCS} --docs-only
245+
- name: "Saving build docs folder"
246+
run: |
247+
if [ -d "generated/_build/" ]; then
248+
mv "generated/_build/" "/tmp/_build"
249+
elif [ -d "docs/_build/" ]; then
250+
# handle Airflow 2 case
251+
mv "docs/_build/" "/tmp/_build"
252+
fi
245253
- name: "Checkout current version to run SBOM generation"
246254
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
247255
with:
248256
persist-credentials: false
249257
fetch-depth: 0
250258
fetch-tags: true
251-
path: current-version
252259
if: inputs.build-sboms
253-
- name: "Reinstall breeze from the current version"
254-
run: |
255-
breeze setup self-upgrade --use-current-airflow-sources
256-
if: inputs.build-sboms
257-
working-directory: current-version
260+
- name: "Install Breeze from the current version"
261+
run: uv tool install -e ./dev/breeze --force
262+
- name: "Restore build docs folder to generated/_build"
263+
run: mv /tmp/_build generated/_build
258264
- name: "Make sure SBOM dir exists and has the right permissions"
259265
run: |
260266
sudo mkdir -vp ./files/sbom
261267
sudo chown -R "${USER}" .
262-
working-directory: current-version
263268
if: inputs.build-sboms
264269
- name: "Prepare SBOMs using current version of Breeze"
265270
env:
@@ -271,17 +276,12 @@ jobs:
271276
breeze sbom update-sbom-information
272277
--airflow-version ${AIRFLOW_VERSION} --remote-name origin --force
273278
--all-combinations --run-in-parallel --airflow-root-path "${GITHUB_WORKSPACE}"
274-
working-directory: current-version
275279
if: inputs.build-sboms
276280
- name: "Generated SBOM files"
277281
run: |
278282
echo "Generated SBOM files:"
279283
find ./generated/_build/docs/apache-airflow/stable/sbom/ -type f | sort
280284
if: inputs.build-sboms
281-
- name: "Reinstall breeze from ${{ inputs.ref }} reference"
282-
run:
283-
breeze setup self-upgrade --use-current-airflow-sources
284-
if: inputs.build-sboms
285285
- name: Check disk space available
286286
run: df -H
287287
# Here we will create temp airflow-site dir to publish docs

0 commit comments

Comments
 (0)