Feat/addsoauthval (#43) #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy to Hugging Face Space | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: # Allow manual triggering | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| # No write permissions needed for GitHub repo (we're pushing to HF Space) | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| - name: Install dependencies | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install huggingface-hub | ||
| - name: Deploy to Hugging Face Space | ||
| env: | ||
| <<<<<<< HEAD | ||
| # Token from secrets (sensitive data) | ||
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| # Username/Organization from repository variables (non-sensitive) | ||
| HF_USERNAME: ${{ vars.HF_USERNAME }} | ||
| # Space name from repository variables (non-sensitive) | ||
| HF_SPACE_NAME: ${{ vars.HF_SPACE_NAME }} | ||
| ======= | ||
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| HF_USERNAME: ${{ secrets.HF_USERNAME }} | ||
| HF_SPACE_NAME: ${{ secrets.HF_SPACE_NAME }} | ||
| >>>>>>> origin/dev | ||
| run: | | ||
| python .github/scripts/deploy_to_hf_space.py | ||
| - name: Verify deployment | ||
| if: success() | ||
| run: | | ||
| echo "✅ Deployment completed successfully!" | ||
| <<<<<<< HEAD | ||
| echo "Space URL: https://huggingface.co/spaces/${{ vars.HF_USERNAME }}/${{ vars.HF_SPACE_NAME }}" | ||
| ======= | ||
| echo "Space URL: https://huggingface.co/spaces/${{ secrets.HF_USERNAME }}/${{ secrets.HF_SPACE_NAME }}" | ||
| >>>>>>> origin/dev | ||