Mikiko Bazeley commited on
Commit
90901ad
1 Parent(s): 37bb9d2

Treating environment variables as secrets

Browse files
Files changed (1) hide show
  1. .github/workflows/sync_hf.yml +8 -6
.github/workflows/sync_hf.yml CHANGED
@@ -9,7 +9,6 @@ on:
9
  jobs:
10
  sync-to-hub:
11
  runs-on: ubuntu-latest
12
- environment: production # Replace with your environment name if applicable
13
  steps:
14
  - uses: actions/checkout@v3
15
  with:
@@ -17,11 +16,14 @@ jobs:
17
  lfs: true
18
  - name: Debug Environment Variables
19
  run: |
20
- echo "HF_USERNAME: $HF_USERNAME"
21
- echo "SPACE_NAME: $SPACE_NAME"
 
 
 
22
  - name: Push to hub
23
  env:
24
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
25
- HF_USERNAME: ${{ env.HF_USERNAME }}
26
- SPACE_NAME: ${{ env.SPACE_NAME }}
27
- run: git push https://$HF_USERNAME:[email protected]/spaces/$HF_USERNAME/$SPACE_NAME main
 
9
  jobs:
10
  sync-to-hub:
11
  runs-on: ubuntu-latest
 
12
  steps:
13
  - uses: actions/checkout@v3
14
  with:
 
16
  lfs: true
17
  - name: Debug Environment Variables
18
  run: |
19
+ echo "HF_USERNAME is set"
20
+ echo "SPACE_NAME is set"
21
+ env:
22
+ HF_USERNAME: ${{ secrets.HF_USERNAME }}
23
+ SPACE_NAME: ${{ secrets.SPACE_NAME }}
24
  - name: Push to hub
25
  env:
26
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
27
+ HF_USERNAME: ${{ secrets.HF_USERNAME }}
28
+ SPACE_NAME: ${{ secrets.SPACE_NAME }}
29
+ run: git push https://${{ env.HF_USERNAME }}:${{ env.HF_TOKEN }}@huggingface.co/spaces/${{ env.HF_USERNAME }}/${{ env.SPACE_NAME }} main