KeerthiVM's picture
Update main.yml
65639d4 unverified
name: Sync to Hugging Face hub
on:
push:
branches: [main]
# to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Push to hub
env:
HF_TOKEN: ${{ secrets.HF_Token }}
run: git push https://KeerthiVM:$HF_TOKEN@huggingface.co/spaces/SkinCancerDiagnosis/Translator_API main --force
notify_slack_on_success:
runs-on: ubuntu-latest
needs: sync-to-hub
if: success()
steps:
- name: Send Slack notification on success
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_SECRET }}
SLACK_COLOR: 'good'
SLACK_TITLE: 'Build Successfully Passed & Deployed for Translator!'
SLACK_MESSAGE: 'Build for `${{ github.repository }}` passed. Commit by @${{ github.actor }}.'
SLACK_FOOTER: 'Changes: ${{ github.event.head_commit.message }}'
notify_slack_on_failure:
runs-on: ubuntu-latest
needs: sync-to-hub
if: failure()
steps:
- name: Send Slack notification on failure
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_SECRET }}
SLACK_COLOR: 'danger'
SLACK_TITLE: 'Build FAILED for Translator!'
SLACK_MESSAGE: '<!here> Build for `${{ github.repository }}` failed. Commit by @${{ github.actor }}. Deployment was skipped.'
SLACK_FOOTER: '<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click to View Failed Run>'