Spaces:
Sleeping
Sleeping
Download .github/workflows/ci_cd.yml from rriviere/attrition-api-dev: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/spaces/rriviere/attrition-api-dev/resolve/main/.github/workflows/ci_cd.yml
- Command line
-
hf download hf://spaces/rriviere/attrition-api-dev/.github/workflows/ci_cd.yml
-
curl -L -o ci_cd.yml https://huggingface.co/spaces/rriviere/attrition-api-dev/resolve/main/.github/workflows/ci_cd.yml
1.62 kB
| name: CI/CD | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout du code | |
| uses: actions/checkout@v4 | |
| - name: Configuration Python 3.12 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Installation des dépendances | |
| run: pip install -r requirements.txt | |
| - name: Exécution des tests | |
| run: pytest tests/ -v | |
| deploy-prod: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout du code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Déploiement sur Hugging Face (prod) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| git config user.email "action@github.com" | |
| git config user.name "GitHub Actions" | |
| git remote add hf https://rriviere:$HF_TOKEN@huggingface.co/spaces/${{ vars.HF_SPACE_PROD }} | |
| git push hf main --force | |
| deploy-dev: | |
| needs: test | |
| if: github.ref == 'refs/heads/dev' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout du code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Déploiement sur Hugging Face (dev) | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| git config user.email "action@github.com" | |
| git config user.name "GitHub Actions" | |
| git remote add hf https://rriviere:$HF_TOKEN@huggingface.co/spaces/${{ vars.HF_SPACE_DEV }} | |
| git push hf HEAD:main --force | |