-
Notifications
You must be signed in to change notification settings - Fork 65
57 lines (48 loc) · 1.74 KB
/
doc-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Build documentation
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
paths:
- 'docs/source/**'
- 'docs/assets/**'
- 'optimum/**'
- '.github/workflows/doc-build.yml'
workflow_dispatch:
jobs:
build_documentation:
runs-on: ubuntu-latest
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
PR_NUMBER: ${{ github.event.number }}
EVENT_CONTEXT: ${{ toJSON(github.event) }}
PR_CLONE_URL: ${{ github.event.pull_request.head.repo.clone_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
cache-dependency-path: "kit/package-lock.json"
- name: Set environment variables
run: |
cd optimum
version=`echo "$(grep '^__version__ =' neuron/version.py | cut -d '=' -f 2- | xargs)"`
if [[ $version == *.dev0 ]]
then
echo "VERSION=main" >> $GITHUB_ENV
else
echo "VERSION=v$version" >> $GITHUB_ENV
fi
cd ..
- name: Setup environment
run: |
pip install ".[quality, diffusers]"
- name: Make documentation
shell: bash
run: |
doc-builder build optimum.neuron docs/source/ --repo_name optimum-neuron --build_dir neuron-doc-build/ --version ${{ env.VERSION }} --version_tag_suffix "" --html --clean
cd neuron-doc-build/
mv optimum.neuron optimum-neuron
doc-builder push optimum-neuron --doc_build_repo_id "hf-doc-build/doc-build" --token "${{ secrets.HF_DOC_BUILD_PUSH }}" --commit_msg "Updated with commit $COMMIT_SHA See: https://github.com/huggingface/optimum-neuron/commit/$COMMIT_SHA" --n_retries 5