Move build docs functionality to workflow (upload.yml) #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Upload latest documentation | |
on: | |
workflow_dispatch: | |
pull_request: # to comment on merge | |
branches: | |
- master | |
env: | |
HF_RAG_REPO: The-OpenROAD-Project/test_repo # To replace with ORAssistant_RAG_Dataset | |
OR_COMMIT_HASH: ffc5760f2df639cd184c40ceba253c7e02a006d5 | |
ORFS_COMMIT_HASH: b94834df01cb58915bc0e8dabf85a314fbd8fb9e | |
OPENSTA_COMMIT_HASH: 1c7f022cd0a02ce71d047aa3dbb64e924b6efbd5 | |
jobs: | |
or-manpages: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up prerequisites | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y make pandoc git | |
- name: Set up python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install huggingface CLI | |
run: | | |
pip install huggingface_hub[cli] python-dotenv beautifulsoup4 | |
- name: Populate environment variables | |
working-directory: ./backend | |
run: | | |
rm -f .env && touch .env | |
echo "OR_REPO_COMMIT=$OR_COMMIT_HASH" >> .env | |
echo "ORFS_REPO_COMMIT=$ORFS_COMMIT_HASH" >> .env | |
echo "OPENSTA_REPO_COMMIT=$OPENSTA_COMMIT_HASH" >> .env | |
- name: Preprocess docs | |
working-directory: ./backend | |
run: | | |
python build_docs.py | |
- name: Login to Huggingface | |
run: | | |
huggingface-cli login --token ${{ secrets.HF_TOKEN }} | |
- name: Upload files | |
working-directory: ./backend | |
run: | | |
huggingface-cli upload ${{ env.HF_RAG_REPO }} ./data / --repo-type dataset | |
- name: Logout from Huggingface | |
run: | | |
huggingface-cli logout |