Skip to content

Commit 7ccf6c0

Browse files
authored
fix(ci): read _versions.yml from the serving bucket (#811)
The main doc build fetched the version list from the legacy doc-build dataset and synced it to the hf-doc-build/doc bucket, which is what moon-landing actually serves. When a release build had only reached the dataset, the bucket ended up advertising a version whose folder it did not have, and hf.co/docs/<package> returned a 404 on its default version (tokenizers v0.23.1). Reading the list from the bucket keeps the served version list consistent with the served content.
1 parent 23dc84b commit 7ccf6c0

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/build_main_documentation.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,18 @@ jobs:
150150
git config --global user.name "Hugging Face Doc Builder"
151151
git config --global user.email docs@huggingface.co
152152
153+
# The version list is read from the bucket we serve from, not from the legacy
154+
# dataset: a version advertised in _versions.yml with no matching folder in the
155+
# bucket makes hf.co/docs/<package> 404 on its default version.
153156
- name: Create build directory
157+
env:
158+
HF_TOKEN: ${{ secrets.hf_token }}
159+
PACKAGE_NAME: ${{ env.package_name }}
154160
run: |
155161
mkdir build_dir
156-
mkdir build_dir/${{ env.package_name }}
157-
cd build_dir/${{ env.package_name }}
158-
wget https://huggingface.co/datasets/hf-doc-build/doc-build/raw/main/${{ env.package_name }}/_versions.yml
162+
mkdir build_dir/$PACKAGE_NAME
163+
cd build_dir/$PACKAGE_NAME
164+
uvx --from huggingface_hub hf cp "hf://buckets/hf-doc-build/doc/$PACKAGE_NAME/_versions.yml" _versions.yml
159165
160166
- name: Run pre-command
161167
shell: bash

0 commit comments

Comments
 (0)