Spaces:
Running
Running
Commit
·
b27e586
1
Parent(s):
5301c48
init commit
Browse files- .github/workflows/cicd.yaml +89 -0
- README.HuggingFace.md +2 -1
- scripts/hug_push.sh +1 -1
.github/workflows/cicd.yaml
ADDED
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Build and Push Docker Image
|
2 |
+
|
3 |
+
# Trigger the pipeline
|
4 |
+
on:
|
5 |
+
workflow_dispatch: # manual trigger
|
6 |
+
push:
|
7 |
+
branches:
|
8 |
+
- test
|
9 |
+
- dev
|
10 |
+
- main
|
11 |
+
|
12 |
+
# Define pipeline jobs
|
13 |
+
jobs:
|
14 |
+
build-image:
|
15 |
+
runs-on: ubuntu-latest
|
16 |
+
|
17 |
+
steps:
|
18 |
+
# Checkout only the latest first commit
|
19 |
+
- uses: actions/checkout@v3
|
20 |
+
with:
|
21 |
+
fetch-depth: 1
|
22 |
+
|
23 |
+
# Set up QEMU for multi-platform Docker builds
|
24 |
+
- name: Set up QEMU
|
25 |
+
uses: docker/setup-qemu-action@v2
|
26 |
+
|
27 |
+
# Set up Docker Buildx for multi-platform support
|
28 |
+
- name: Set up Docker Buildx
|
29 |
+
uses: docker/setup-buildx-action@v2
|
30 |
+
|
31 |
+
# Log in to DockerHub
|
32 |
+
- name: Login to DockerHub
|
33 |
+
uses: docker/login-action@v2
|
34 |
+
with:
|
35 |
+
username: ${{ secrets.DOCKER_USERNAME }}
|
36 |
+
password: ${{ secrets.DOCKER_PASSWORD }}
|
37 |
+
|
38 |
+
# Cache Docker layers to speed up builds
|
39 |
+
- name: Cache Docker layers
|
40 |
+
uses: actions/cache@v3
|
41 |
+
with:
|
42 |
+
path: /tmp/.buildx-cache
|
43 |
+
key: ${{ runner.os }}-buildx-${{ hashFiles('**/Dockerfile', '**/package-lock.json') }}
|
44 |
+
restore-keys: |
|
45 |
+
${{ runner.os }}-buildx-
|
46 |
+
|
47 |
+
# Build and push Docker image to DockerHub and GHCR
|
48 |
+
- name: Build and push Docker images
|
49 |
+
uses: docker/build-push-action@v2
|
50 |
+
with:
|
51 |
+
platforms: linux/amd64
|
52 |
+
context: .
|
53 |
+
push: true
|
54 |
+
# Define dynamic tags based on branch name
|
55 |
+
tags: |
|
56 |
+
synthetic-data-${{ github.ref_name }}:latest
|
57 |
+
cache-from: type=local,src=/tmp/.buildx-cache
|
58 |
+
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
|
59 |
+
|
60 |
+
# deploy:
|
61 |
+
# needs: build-image
|
62 |
+
# runs-on: ubuntu-latest
|
63 |
+
# steps:
|
64 |
+
# - name: Checkout code
|
65 |
+
# uses: actions/checkout@v3
|
66 |
+
|
67 |
+
# - name: Configure AWS credentials
|
68 |
+
# uses: aws-actions/configure-aws-credentials@v1
|
69 |
+
# with:
|
70 |
+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
71 |
+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
72 |
+
# aws-region: us-west-1
|
73 |
+
|
74 |
+
# # Update kubeconfig to the correct EKS cluster based on the branch
|
75 |
+
# - name: Update kubeconfig
|
76 |
+
# run: |
|
77 |
+
# if [[ "${{ github.ref_name }}" == "main" ]]; then
|
78 |
+
# aws eks update-kubeconfig --name Prod --region us-west-1
|
79 |
+
# elif [[ "${{ github.ref_name }}" == "dev" ]]; then
|
80 |
+
# aws eks update-kubeconfig --name Dev --region us-west-1
|
81 |
+
# elif [[ "${{ github.ref_name }}" == "test" ]]; then
|
82 |
+
# aws eks update-kubeconfig --name test --region us-west-1
|
83 |
+
# fi
|
84 |
+
|
85 |
+
# # Deploy to EKS
|
86 |
+
# - name: Deploy to EKS
|
87 |
+
# run: |
|
88 |
+
# kubectl rollout restart deployment ai-agent-service --namespace intersoul
|
89 |
+
|
README.HuggingFace.md
CHANGED
@@ -174,4 +174,5 @@ Then visit:
|
|
174 |
|
175 |
docker run -d -p 7860:7860 --name starfish-app -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf -v $(pwd)/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf starfish-app
|
176 |
|
177 |
-
docker build -t starfish-app .
|
|
|
|
174 |
|
175 |
docker run -d -p 7860:7860 --name starfish-app -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf -v $(pwd)/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf starfish-app
|
176 |
|
177 |
+
docker build -t starfish-app .
|
178 |
+
docker build --no-cache -t your-image-name:your-tag .
|
scripts/hug_push.sh
CHANGED
@@ -1 +1 @@
|
|
1 |
-
git push hug
|
|
|
1 |
+
git push hug vam_agent:main
|