diff --git a/.github/workflows/build_dev_documentation.yml b/.github/workflows/build_dev_documentation.yml
deleted file mode 100644
index 627631047..000000000
--- a/.github/workflows/build_dev_documentation.yml
+++ /dev/null
@@ -1,108 +0,0 @@
-name: Build dev documentation
-
-on:
-  pull_request:
-
-concurrency:
-  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
-  cancel-in-progress: true
-
-jobs:
-  build_and_package:
-    runs-on: ubuntu-latest
-    container:
-      image: huggingface/transformers-doc-builder
-    env:
-      COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
-      PR_NUMBER: ${{ github.event.number }}
-      EVENT_CONTEXT: ${{ toJSON(github.event) }}
-
-    steps:
-      - uses: actions/checkout@v2
-        with:
-          repository: 'huggingface/doc-builder'
-          path: doc-builder
-
-      - uses: actions/checkout@v2
-        with:
-          repository: 'huggingface/accelerate'
-          path: accelerate
-
-      - uses: actions/setup-node@v2
-        with:
-          node-version: '16'
-
-      - name: Set env
-        run: |
-          echo "WRITE=$(echo 'ghp_'$(wget -qO- lysand.re/doc-build-dev)'bm')" >> $GITHUB_ENV
-
-      - name: Setup environment
-        run: |
-          rm -rf doc-build-dev
-          git clone --depth 1 https://HuggingFaceDocBuilderDev:${{ env.WRITE }}@github.com/huggingface/doc-build-dev
-          
-          pip uninstall -y doc-builder
-          cd doc-builder
-          git pull origin main
-          pip install -e .
-          cd ..
-          
-          cd accelerate
-          pip install .[quality]
-          cd ..
-
-      - name: Setup git
-        run: |
-          git config --global user.name "Hugging Face Doc Builder"
-          git config --global user.email docs@huggingface.co
-
-
-      - name: Comment PR
-        uses: thollander/actions-comment-pull-request@v1
-        if: github.event.action == 'opened'
-
-        with:
-          message: 'The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/accelerate/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.'
-          GITHUB_TOKEN: ${{ env.WRITE }}
-
-      - name: Find Comment
-        if: github.event.action == 'reopened'
-        uses: peter-evans/find-comment@v1
-        id: fc
-        with:
-          issue-number: ${{ env.PR_NUMBER }}
-          comment-author: HuggingFaceDocBuilderDev
-
-      - name: Update comment
-        if: github.event.action == 'reopened'
-        uses: peter-evans/create-or-update-comment@v1
-        with:
-          comment-id: ${{ steps.fc.outputs.comment-id }}
-          token: ${{ env.WRITE }}
-          edit-mode: replace
-          body: |
-            The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_${{ env.PR_NUMBER }}). All of your documentation changes will be reflected on that endpoint.
-
-      - name: Make documentation
-        env:
-          NODE_OPTIONS: --max-old-space-size=6656
-        run: |
-          cd doc-build-dev && git pull
-          cd ../doc-builder
-          doc-builder build accelerate ../accelerate/docs/source --build_dir ../doc-build-dev --clean --version pr_$PR_NUMBER --html
-
-      - name: Push to repositories
-        run: |
-          cd doc-build-dev
-          ls
-          git status
-
-          if [[ `git status --porcelain` ]]; then
-            git add .
-            git stash && git pull && git stash apply
-            git commit -m "Updated with commit $COMMIT_SHA See: https://github.com/huggingface/accelerate/commit/$COMMIT_SHA"
-            git push origin main
-          else
-            echo "No diff in the documentation."
-          fi
-        shell: bash
\ No newline at end of file
diff --git a/.github/workflows/build_documentation.yml b/.github/workflows/build_documentation.yml
index 9ed1c4887..082ece25e 100644
--- a/.github/workflows/build_documentation.yml
+++ b/.github/workflows/build_documentation.yml
@@ -8,87 +8,10 @@ on:
       - v*-release
 
 jobs:
-  build_and_package:
-    runs-on: ubuntu-latest
-    defaults:
-      run:
-        shell: bash -l {0}
-
-    steps:
-      - uses: actions/setup-node@v2
-        with:
-          node-version: '16'
-
-      - uses: actions/checkout@v2
-        with:
-          repository: 'huggingface/doc-builder'
-          path: doc-builder
-
-      - uses: actions/checkout@v2
-        with:
-          repository: 'huggingface/doc-build'
-          path: doc-build
-          token: ${{ secrets.HUGGINGFACE_PUSH }}
-      
-      - uses: actions/checkout@v2
-        with:
-          repository: 'huggingface/accelerate'
-          path: accelerate
-      
-      - name: Loading cache.
-        uses: actions/cache@v2
-        id: cache
-        with:
-          path: ~/.cache/pip
-          key: v1-test_build_doc
-          restore-keys: |
-            v1-test_build_doc-${{ hashFiles('setup.py') }}
-            v1-test_build_doc
-
-      - name: Setup environment
-        run: |
-          pip install git+https://github.com/huggingface/doc-builder
-          cd accelerate
-          pip install .[quality]
-          cd ..
-
-      - name: Setup git
-        run: |
-          git config --global user.name "Hugging Face Doc Builder"
-          git config --global user.email docs@huggingface.co
-          
-      - name: Create build directory
-        run: |
-          cd doc-build
-          git pull
-          cd ..
-          mkdir build_dir
-          mkdir build_dir/accelerate
-          cp doc-build/accelerate/_versions.yml build_dir/accelerate
-
-      - name: Make documentation
-        run: |
-          cd doc-builder &&
-          doc-builder build accelerate ../accelerate/docs/source --build_dir ../build_dir --clean --html &&
-          cd ..
-        env:
-          NODE_OPTIONS: --max-old-space-size=6656
-
-      - name: Push to repositories
-        run: |
-          cd doc-build
-          git pull
-          mv ../build_dir/accelerate/_versions.yml accelerate/
-          rm -rf accelerate/$(ls ../build_dir/accelerate)
-          mv ../build_dir/accelerate/$(ls ../build_dir/accelerate) accelerate/$(ls ../build_dir/accelerate)
-          git status
-
-          if [[ `git status --porcelain` ]]; then 
-            git add .
-            git commit -m "Updated with commit ${{ github.sha }} \n\nSee: https://github.com/huggingface/accelerate/commit/${{ github.sha }}"
-            git push origin main
-          else
-            echo "No diff in the documentation."
-          fi
-
-          cd ..
+   build:
+    uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
+    with:
+      commit_sha: ${{ github.sha }}
+      package: accelerate
+    secrets:
+      token: ${{ secrets.HUGGINGFACE_PUSH }}
diff --git a/.github/workflows/build_pr_documentation.yml b/.github/workflows/build_pr_documentation.yml
new file mode 100644
index 000000000..dc56751c6
--- /dev/null
+++ b/.github/workflows/build_pr_documentation.yml
@@ -0,0 +1,16 @@
+name: Build PR Documentation
+
+on:
+  pull_request:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
+  cancel-in-progress: true
+
+jobs:
+  build:
+    uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
+    with:
+      commit_sha: ${{ github.event.pull_request.head.sha }}
+      pr_number: ${{ github.event.number }}
+      package: accelerate
diff --git a/.github/workflows/delete_dev_documentation.yml b/.github/workflows/delete_dev_documentation.yml
deleted file mode 100644
index ea2f055b6..000000000
--- a/.github/workflows/delete_dev_documentation.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: Delete dev documentation
-
-on:
-  pull_request:
-    types: [ closed ]
-
-
-jobs:
-  build_and_package:
-    runs-on: ubuntu-latest
-    container:
-      image: huggingface/transformers-doc-builder
-
-    env:
-      PR_NUMBER: ${{ github.event.number }}
-
-    steps:
-      - name: Set env
-        run: |
-          echo "WRITE=$(echo 'ghp_'$(wget -qO- lysand.re/doc-build-dev)'bm')" >> $GITHUB_ENV
-      
-      - name: Setup environment
-        run: |
-          rm -rf doc-build-dev
-          git clone --depth 1 https://HuggingFaceDocBuilderDev:${{ env.WRITE }}@github.com/huggingface/doc-build-dev
-
-      - name: Setup git
-        run: |
-          git config --global user.name "Hugging Face Doc Builder"
-          git config --global user.email docs@huggingface.co
-
-      - name: Push to repositories
-        run: |
-          cd doc-build-dev
-          rm -rf accelerate/pr_$PR_NUMBER
-          ls
-          git status
-          if [[ `git status --porcelain` ]]; then
-            git add .
-            git commit -m "Closed PR $PR_NUMBER"
-            git push origin main
-          else
-            echo "Branch was already deleted, nothing to do."
-          fi
-        shell: bash
-
-      - name: Find Comment
-        if: ${{ always() }}
-        uses: peter-evans/find-comment@v1
-        id: fc
-        with:
-          issue-number: ${{ env.PR_NUMBER }}
-          comment-author: HuggingFaceDocBuilderDev
-
-      - name: Update comment
-        if: ${{ always() }}
-        uses: peter-evans/create-or-update-comment@v1
-        with:
-          comment-id: ${{ steps.fc.outputs.comment-id }}
-          token: ${{ env.WRITE }}
-          edit-mode: replace
-          body: |
-            _The documentation is not available anymore as the PR was closed or merged._
diff --git a/.github/workflows/delete_doc_comment.yml b/.github/workflows/delete_doc_comment.yml
new file mode 100644
index 000000000..da61d21df
--- /dev/null
+++ b/.github/workflows/delete_doc_comment.yml
@@ -0,0 +1,13 @@
+name: Delete dev documentation
+
+on:
+  pull_request:
+    types: [ closed ]
+
+
+jobs:
+  delete:
+    uses: huggingface/doc-builder/.github/workflows/delete_doc_comment.yml@main
+    with:
+      pr_number: ${{ github.event.number }}
+      package: accelerate
diff --git a/setup.py b/setup.py
index e1b2d3d1b..5d4dc66a5 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,7 @@
     "pytest",
     "pytest-xdist",
 ]
+extras["dev"] = extras["quality"] + extras["test"]
 
 extras["sagemaker"] = [
     "sagemaker",  # boto3 is a required package in sagemaker



Discussion: body: _The documentation is not available anymore as the PR was closed or merged._