CI/CD: GitHub Actions and Hugging Face space
The tutorial will follow the following online resources:
Setup GitHub Repository and workspace
Create a GitHub Repository and use Codespaces for development
Create a virtual environment in the code space and update it on bashrc file
Add requirement.txt and app.py, Makefile, and Readme, same as available in the git repository
Issue make install command to setup and test the text summarization of all requirements
Setup Hugging Face Space
Create Hugging Face space using Gradio SDK
Create Access Token with write permission on Hugging Face Action
Copy the Access Token
GitHub Action for CI/CD
Create a Repository Secrete for Hugging Face Access Token
Create a workflow action and copy the code from [GitHub Action Workflow File ]
Make sure to update the script with your username/id for the Hugging Face space that you create and update the repository secrete name appropriately
Commit the workflow file and check the GitHub Actions running.
If everything works fine, you can see your Hugging Face space is in a running state. You have just built a simple CI/CD pipeline that uses the HuggingFace NLP model and deploys the model to the Hugging Face space!