refactor: Update factory_restart_space.py to use environment variable for Hugging Face API token
This commit is contained in:
parent
aafaa166b4
commit
5fe568cc6c
1 changed files with 22 additions and 4 deletions
26
.github/workflows/docker-build.yml
vendored
26
.github/workflows/docker-build.yml
vendored
|
|
@ -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 }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue