Update README.md #11
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: CD to Hugging Face | |
on: | |
push: | |
branches: | |
- main # Trigger on pushes to the 'main' branch | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Checkout the repository | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# Step 2: Set up Python environment | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
# Step 3: Install dependencies | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
# Step 4: Deploy to Hugging Face Hub | |
- name: Deploy to Hugging Face | |
env: | |
HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
run: | | |
# Install Hugging Face CLI | |
python -m pip install huggingface_hub | |
# Login to Hugging Face Hub | |
huggingface-cli login --token "${{ secrets.HF_TOKEN }}" | |
# Create a new repository named 'CyberAttackDetection' under your username | |
huggingface-cli repo create CyberAttackDetection --type model --yes --organization canstralian | |
# Upload all files from the 'model_files' directory to the new repository | |
huggingface-cli upload ./model_files/* --repo_id canstralian/CyberAttackDetection |