From 0fb8b7ba5fadcad56f34f3245ae225998c9fdcc7 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 16:53:38 +0900 Subject: [PATCH 01/11] Create main.yml add git actions for deployment to hugging face --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c8b7d19 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,24 @@ +name: Sync to Hugging Face hub +on: + push: + branches: [main] + workflow_dispatch: + + jobs: + sync-to-hub: + runs-on: ubuntu-latest + steps: + -uses: actions/checkout@v4 + with: + fetch-depth: 0 + -name: Add remote + env: + HF: ${{secrets.HF}} + run: git remote add space https://huggingface.co/spaces/kumarajit/mlops-coursera + -name: Push to hub + env: + HF: ${{secrets.HF}} + run: git push --force https://huggingface.co/spaces/kumarajit/mlops-coursera main + + + From 98fe3826f8450b1643a3dbe5fda35b1bb01e5b5a Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 16:55:32 +0900 Subject: [PATCH 02/11] Update main.yml correction error --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c8b7d19..337ff2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,7 +8,7 @@ on: sync-to-hub: runs-on: ubuntu-latest steps: - -uses: actions/checkout@v4 + -uses: actions/checkout@v2 with: fetch-depth: 0 -name: Add remote From 55337384b98fff85a089ed4dff9ee2de4e1360aa Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 16:56:24 +0900 Subject: [PATCH 03/11] Update main.yml file name correcton --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 337ff2b..842c01a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,14 +8,14 @@ on: sync-to-hub: runs-on: ubuntu-latest steps: - -uses: actions/checkout@v2 + - uses: actions/checkout@v2 with: fetch-depth: 0 - -name: Add remote + - name: Add remote env: HF: ${{secrets.HF}} run: git remote add space https://huggingface.co/spaces/kumarajit/mlops-coursera - -name: Push to hub + - name: Push to hub env: HF: ${{secrets.HF}} run: git push --force https://huggingface.co/spaces/kumarajit/mlops-coursera main From 33fc65f861c7c0893f1be215f3db11d94fc28006 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:15:27 +0900 Subject: [PATCH 04/11] Update main.yml Replace actions setting using hugging face --- .github/workflows/main.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 842c01a..dfc7e41 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,24 +1,24 @@ name: Sync to Hugging Face hub -on: - push: - branches: [main] +on: + push: + branches: [main] + + # to run this workflow manually from the Actions tab workflow_dispatch: - jobs: +jobs: sync-to-hub: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + lfs: true - name: Add remote - env: - HF: ${{secrets.HF}} - run: git remote add space https://huggingface.co/spaces/kumarajit/mlops-coursera + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} + run: git remote add space https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera - name: Push to hub - env: - HF: ${{secrets.HF}} - run: git push --force https://huggingface.co/spaces/kumarajit/mlops-coursera main - - - + env: + HF_TOKEN: ${{ secrets.HF_TOKEN }} + run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera From 2551a6946d2e12223eba905cdf4be356d9bab183 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:16:27 +0900 Subject: [PATCH 05/11] Update main.yml Updagte action version to v4 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dfc7e41..6c046db 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: sync-to-hub: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 lfs: true From 1914ce8de70cf9812cee8aad1ab5574877fd28fa Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:21:16 +0900 Subject: [PATCH 06/11] Update main.yml added space repo as one branch --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c046db..2a91330 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: - name: Add remote env: HF_TOKEN: ${{ secrets.HF_TOKEN }} - run: git remote add space https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera + run: git remote add space https://huggingface.co/spaces/kumarajit/mlops-coursera - name: Push to hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} From 9f78746fe0ba505bd6fc57f4b108d5996e1357ae Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:35:30 +0900 Subject: [PATCH 07/11] Update main.yml --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a91330..2281d59 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,10 +14,6 @@ jobs: with: fetch-depth: 0 lfs: true - - name: Add remote - env: - HF_TOKEN: ${{ secrets.HF_TOKEN }} - run: git remote add space https://huggingface.co/spaces/kumarajit/mlops-coursera - name: Push to hub env: HF_TOKEN: ${{ secrets.HF_TOKEN }} From 10cac07a88235fec08bdba823914f2006dc29c92 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:45:22 +0900 Subject: [PATCH 08/11] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2281d59..1e7508a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,5 +16,5 @@ jobs: lfs: true - name: Push to hub env: - HF_TOKEN: ${{ secrets.HF_TOKEN }} + HF_TOKEN: ${{ secrets.HG }} run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera From 2354af8f182dd3904bfe94c36c32a0b577e9e81f Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:48:57 +0900 Subject: [PATCH 09/11] Update main.yml ADDED NEW SPACE --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1e7508a..7ea592d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,4 +17,4 @@ jobs: - name: Push to hub env: HF_TOKEN: ${{ secrets.HG }} - run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera + run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera-demo From 664b19b06d8763df7de0fc471bc3135c4a2c9324 Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:51:24 +0900 Subject: [PATCH 10/11] Update main.yml --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ea592d..2055bd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,11 @@ jobs: with: fetch-depth: 0 lfs: true + - name: Add remote + env: + HF_TOKEN: ${{ secrets.HG }} + run: git remote add space https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera-demo - name: Push to hub env: HF_TOKEN: ${{ secrets.HG }} - run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera-demo + run: git push https://kumarajit:$HF_TOKEN@huggingface.co/spaces/kumarajit/mlops-coursera-demo main From 1906c286a5c81e29af8b0659cf5126f315fca9ec Mon Sep 17 00:00:00 2001 From: Ajit Kumar Date: Fri, 16 Feb 2024 17:56:04 +0900 Subject: [PATCH 11/11] Update main.yml --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2055bd9..8dfe209 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,8 +12,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 - lfs: true + fetch-depth: 0 - name: Add remote env: HF_TOKEN: ${{ secrets.HG }}