Unverified Commit 852735ec authored by Muyang Li's avatar Muyang Li Committed by GitHub
Browse files

chore: fix the build-docs workflow (#556)

* debugging the workflow

* debugging the workflow

* debug workflow

* debug workflow

* fix the rsa keys

* style: make linter happy
parent ae2a1d72
...@@ -5,10 +5,16 @@ on: ...@@ -5,10 +5,16 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
tag: tag:
name: Check if main branch is a dev version name: Build and deploy docs
runs-on: [self-hosted, blackwell] runs-on: [self-hosted, blackwell]
if: github.repository == 'nunchaku-tech/nunchaku' if: github.repository == 'nunchaku-tech/nunchaku'
steps: steps:
- name: Test ssh
run: |
echo "${{ secrets.DO_SSH_KEY }}" > ./id_rsa
chmod 600 id_rsa
ssh -o StrictHostKeyChecking=no -i id_rsa ${{ secrets.DO_USER }}@${{ secrets.DO_HOST }} "echo SSH connection successful"
rm id_rsa
- name: Checkout main branch - name: Checkout main branch
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
...@@ -48,14 +54,12 @@ jobs: ...@@ -48,14 +54,12 @@ jobs:
make html make html
- name: Deploy docs - name: Deploy docs
run: | run: |
echo "${{ secrets.DO_SSH_KEY }}" > ./id_rsa
chmod 600 id_rsa
source $(conda info --base)/etc/profile.d/conda.sh source $(conda info --base)/etc/profile.d/conda.sh
conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; } conda activate nunchaku-docs || { echo "Failed to activate conda env"; exit 1; }
which python which python
rsync -avz --delete docs/build/html/ ${{ secrets.DO_USER }}@${{ secrets.DO_HOST }}:${{ secrets.DO_DOCS_ROOT }}/nunchaku-nightly rsync -avz --delete docs/build/html/ ${{ secrets.DO_USER }}@${{ secrets.DO_HOST }}:${{ secrets.DO_DOCS_ROOT }}/nunchaku-nightly
rm id_rsa
env: env:
RSYNC_RSH: "ssh -o StrictHostKeyChecking=no -i ${{ secrets.DO_SSH_KEY }}" RSYNC_RSH: "ssh -o StrictHostKeyChecking=no -i id_rsa"
- name: Clean up
if: always() && github.repository == 'nunchaku-tech/nunchaku'
run: |
cd ..
rm -r nunchaku
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment