name: CI/CD | |
on: | |
push: | |
tags: ["v[0-9].[0-9]+.[0-9]+"] | |
branches: ["*"] | |
jobs: | |
huggingface_deploy: | |
name: Deploy to Hugging Face | |
runs-on: ubuntu-latest | |
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} | |
fetch-depth: 0 | |
- name: Setup Git Config | |
run: | | |
git checkout main | |
git config --global user.email "[email protected]" | |
git config --global user.name "Hasan Iqbal" | |
- name: Enable HuggingFace Spaces Config | |
run: | | |
READMEFILE="README.md" | |
sed -i 's/<!--/---/g; s/-->/---/g' $READMEFILE | |
git add $READMEFILE | |
git commit -m "Uncommented HuggingFace Spaces Configuration" || echo "No changes to commit" | |
- name: Push to Hugging Face | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: git push https://hasaniqbal777:[email protected]/spaces/hasaniqbal777/OpenFactCheck main --force | |