KeerthiVM commited on
Commit
5b2c353
·
unverified ·
1 Parent(s): d9e2abb

Create main.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +46 -0
.github/workflows/main.yml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face hub
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ # to run this workflow manually from the Actions tab
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ sync-to-hub:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ with:
14
+ fetch-depth: 0
15
+ lfs: true
16
+ - name: Push to hub
17
+ env:
18
+ HF_TOKEN: ${{ secrets.HF_Token }}
19
+ run: git push https://KeerthiVM:$HF_TOKEN@huggingface.co/spaces/SkinCancerDiagnosis/CaseStudy2 main --force
20
+ notify_slack_on_success:
21
+ runs-on: ubuntu-latest
22
+ needs: sync-to-hub
23
+ if: success()
24
+ steps:
25
+ - name: Send Slack notification on success
26
+ uses: rtCamp/action-slack-notify@v2
27
+ env:
28
+ SLACK_WEBHOOK: ${{ secrets.SLACK_SECRET }}
29
+ SLACK_COLOR: 'good'
30
+ SLACK_TITLE: 'Build Successfully Passed & Deployed for Translator!'
31
+ SLACK_MESSAGE: 'Build for `${{ github.repository }}` passed. Commit by @${{ github.actor }}.'
32
+ SLACK_FOOTER: 'Changes: ${{ github.event.head_commit.message }}'
33
+
34
+ notify_slack_on_failure:
35
+ runs-on: ubuntu-latest
36
+ needs: sync-to-hub
37
+ if: failure()
38
+ steps:
39
+ - name: Send Slack notification on failure
40
+ uses: rtCamp/action-slack-notify@v2
41
+ env:
42
+ SLACK_WEBHOOK: ${{ secrets.SLACK_SECRET }}
43
+ SLACK_COLOR: 'danger'
44
+ SLACK_TITLE: 'Build FAILED for Translator!'
45
+ SLACK_MESSAGE: '<!here> Build for `${{ github.repository }}` failed. Commit by @${{ github.actor }}. Deployment was skipped.'
46
+ SLACK_FOOTER: '<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click to View Failed Run>'