diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 2c8e61547..8cb6d0a8d 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -54,10 +54,28 @@ jobs: tags: ${{ env.TAGS }} - name: Wait for Docker Hub to propagate run: sleep 120 - - name: Restart HuggingFace Spaces Build - # There's a script in ./scripts/factory_reset_space.py that will reset the build - # using the HUGGINGFACE_API_TOKEN secret + + restart-space: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.12" + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} + uses: "./.github/actions/poetry_caching" + with: + python-version: ${{ matrix.python-version }} + poetry-version: ${{ env.POETRY_VERSION }} + cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }} + - name: Install Python dependencies run: | - python ./scripts/factory_restart_space.py + poetry env use ${{ matrix.python-version }} + poetry install + + - name: Restart HuggingFace Spaces Build + run: | + poetry run python ./scripts/factory_restart_space.py env: HUGGINGFACE_API_TOKEN: ${{ secrets.HUGGINGFACE_API_TOKEN }}