Skip to content

Commit 5fe568c

Browse files
committed
refactor: Update factory_restart_space.py to use environment variable for Hugging Face API token
1 parent aafaa16 commit 5fe568c

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/docker-build.yml

+21-3
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,28 @@ jobs:
5454
tags: ${{ env.TAGS }}
5555
- name: Wait for Docker Hub to propagate
5656
run: sleep 120
57+
58+
restart-space:
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
python-version:
63+
- "3.12"
64+
steps:
65+
- uses: actions/checkout@v4
66+
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
67+
uses: "./.github/actions/poetry_caching"
68+
with:
69+
python-version: ${{ matrix.python-version }}
70+
poetry-version: ${{ env.POETRY_VERSION }}
71+
cache-key: ${{ runner.os }}-poetry-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}
72+
- name: Install Python dependencies
73+
run: |
74+
poetry env use ${{ matrix.python-version }}
75+
poetry install
76+
5777
- name: Restart HuggingFace Spaces Build
58-
# There's a script in ./scripts/factory_reset_space.py that will reset the build
59-
# using the HUGGINGFACE_API_TOKEN secret
6078
run: |
61-
python ./scripts/factory_restart_space.py
79+
poetry run python ./scripts/factory_restart_space.py
6280
env:
6381
HUGGINGFACE_API_TOKEN: ${{ secrets.HUGGINGFACE_API_TOKEN }}

0 commit comments

Comments
 (0)