diff --git a/.github/workflows/sync_huggingface.yml b/.github/workflows/sync_huggingface.yml new file mode 100644 index 0000000..c7ef4d4 --- /dev/null +++ b/.github/workflows/sync_huggingface.yml @@ -0,0 +1,33 @@ +name: Sync with Huggingface + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Sync with Huggingface + env: + HUGGINGFACE_API_KEY: ${{ secrets.HUGGINGFACE_API_KEY }} + run: | + python sync_huggingface.py diff --git a/infra/k8s/deployment.yaml b/infra/k8s/deployment.yaml index 3c90476..9cd7f6f 100644 --- a/infra/k8s/deployment.yaml +++ b/infra/k8s/deployment.yaml @@ -1,4 +1,3 @@ - apiVersion: apps/v1 kind: Deployment metadata: @@ -18,3 +17,9 @@ spec: image: cybersecurity/framework:latest ports: - containerPort: 5000 + env: + - name: HUGGINGFACE_API_KEY + valueFrom: + secretKeyRef: + name: huggingface-secret + key: api_key diff --git a/infra/k8s_deployment.yaml b/infra/k8s_deployment.yaml index 26aa1f8..75be2d1 100644 --- a/infra/k8s_deployment.yaml +++ b/infra/k8s_deployment.yaml @@ -1,4 +1,3 @@ - apiVersion: apps/v1 kind: Deployment metadata: @@ -24,3 +23,8 @@ spec: secretKeyRef: name: openai-secret key: api_key + - name: HUGGINGFACE_API_KEY + valueFrom: + secretKeyRef: + name: huggingface-secret + key: api_key