Merge pull request #27 from jacksonkasi1/dev #48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Hugging Face Space | |
on: | |
push: | |
branches: | |
- main | |
# - dev | |
workflow_dispatch: | |
jobs: | |
deploy-to-huggingface: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: server/imagepro-file-process | |
steps: | |
# 1. Checkout the code from the GitHub repository | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
# 2. Set up SSH key | |
- name: Set up SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.HF_SSH_KEY }} | |
# 3. Initialize Git repository in subdirectory | |
- name: Initialize Git repository | |
run: | | |
git init | |
git branch -m main | |
git remote add origin [email protected]:spaces/jacksonkasi/imagepro-file-process.git | |
# 4. Configure Git user | |
- name: Configure Git user | |
run: | | |
git config user.name "jacksonkasi1" | |
git config user.email "[email protected]" | |
# 5. Disable strict host key checking | |
- name: Disable strict host key checking | |
run: | | |
echo -e "Host hf.co\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config | |
# 6. Add and commit files | |
- name: Add and commit files | |
run: | | |
git add . | |
git commit -m "Deploy to Hugging Face Space" | |
# 7. Push to Hugging Face Space | |
- name: Push to Hugging Face Space | |
run: | | |
git push -u origin main --force |