Team Ai
Apppublic

gvatsal60/github-test

sourceHugging Faceapache-2.0updated 5d agoView on Hugging Face
0likes
huggingface-test.yaml44 linesDownload Raw Back to workflows
1name: Test on Hugging Face hub2on:3  pull_request:4    branches: ["*"]5permissions:6  contents: write7  pull-requests: write8jobs:9  build-docker-image:10    runs-on: ubuntu-latest11    steps:12      - name: Checkout repository13        uses: actions/checkout@v714      - name: Build Docker image15        env:16          IMAGE_NAME: ${{ github.repository_owner }}/github-test17        run: |18          docker build -t $IMAGE_NAME .19  sync-to-hub:20    needs: build-docker-image21    runs-on: ubuntu-latest22    environment: HF_TOKEN23    steps:24      - name: Checkout repository25        uses: actions/checkout@v726        with:27          ref: ${{ github.head_ref }}28          fetch-depth: 029          lfs: true30      - name: Configure Git31        run: |32          git config --global user.email "action@github.com"33          git config --global user.name "github-actions"34      - name: Push to Hugging Face Hub35        env:36          HF_TOKEN: ${{ secrets.HF_TOKEN }}37          HF_USERNAME: ${{ github.repository_owner }}38          HF_SPACE: ${{ github.repository_owner }}/github-test39          HF_BRANCH: main40          PR_BRANCH: ${{ github.head_ref }}41        run: |42          git remote set-url origin https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_SPACE43          git push origin $PR_BRANCH:$HF_BRANCH --force44