macrdel commited on
Commit
1bcd8bd
β€’
1 Parent(s): 439a408

update workflows

Browse files
.github/workflows/deploy.yml CHANGED
@@ -1,49 +1,20 @@
1
- name: Deploy to Hugging Face Spaces
2
 
3
  on:
4
  push:
5
- branches:
6
- - master
7
 
 
8
  workflow_dispatch:
9
 
10
  jobs:
11
- test-and-deploy:
12
  runs-on: ubuntu-latest
13
-
14
  steps:
15
- - name: Checkout code
16
- uses: actions/checkout@v2
17
-
18
- - name: Set up Docker Buildx
19
- uses: docker/setup-buildx-action@v1
20
-
21
- - name: Login to DockerHub
22
- uses: docker/login-action@v1
23
- with:
24
- username: ${{ secrets.DOCKER_USERNAME }}
25
- password: ${{ secrets.DOCKER_PASSWORD }}
26
-
27
- - name: Run tests
28
- run: docker-compose up tests
29
-
30
- - name: Build Docker image
31
- if: success()
32
- run: docker build -t macrdel/sentiment-summarize-youtube-comments-backend:latest .
33
-
34
- - name: Push Docker image
35
- if: success()
36
- run: docker push macrdel/sentiment-summarize-youtube-comments-backend:latest
37
-
38
- - name: Deploy to Hugging Face Spaces
39
- if: success()
40
- env:
41
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
42
- #HF_USER: ${{ secrets.HF_USER }}
43
- run: |
44
- git remote add huggingface https://macrdel:$HF_TOKEN@huggingface.co/spaces/macrdel/sentiment-summarize-youtube-comms
45
- git fetch --unshallow huggingface
46
- git branch -r
47
- git checkout -b main
48
- git push --force https://macrdel:$HF_TOKEN@huggingface.co/spaces/macrdel/sentiment-summarize-youtube-comms main
49
-
 
1
+ name: Deploy to Hugging Face spaces
2
 
3
  on:
4
  push:
5
+ branches: [main]
 
6
 
7
+ # to run this workflow manually from the Actions tab
8
  workflow_dispatch:
9
 
10
  jobs:
11
+ sync-to-hub:
12
  runs-on: ubuntu-latest
 
13
  steps:
14
+ - uses: actions/checkout@v2
15
+ with:
16
+ fetch-depth: 0
17
+ - name: Push to hub
18
+ env:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: git push --force https://macrdel:$HF_TOKEN@huggingface.co/spaces/macrdel/sentiment-summarize-youtube-comms main
 
 
 
 
 
 
 
.github/workflows/test_build.yml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Unit tests and Docker build
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ test-and-deploy:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout code
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Set up Docker Buildx
17
+ uses: docker/setup-buildx-action@v1
18
+
19
+ - name: Login to DockerHub
20
+ uses: docker/login-action@v1
21
+ with:
22
+ username: ${{ secrets.DOCKER_USERNAME }}
23
+ password: ${{ secrets.DOCKER_PASSWORD }}
24
+
25
+ - name: Run tests
26
+ run: docker-compose up tests
27
+
28
+ - name: Build Docker image
29
+ if: success()
30
+ run: docker build -t macrdel/sentiment-summarize-youtube-comments-backend:latest .
31
+
32
+ - name: Push Docker image
33
+ if: success()
34
+ run: docker push macrdel/sentiment-summarize-youtube-comments-backend:latest
docker-compose.yml CHANGED
@@ -17,7 +17,7 @@ services:
17
  ports:
18
  - "80:80"
19
  volumes:
20
- - ./config/nginx.conf:/etc/nginx/nginx.conf:ro
21
  depends_on:
22
  - app
23
  networks:
@@ -27,7 +27,7 @@ services:
27
  image: prom/prometheus
28
  container_name: prometheus
29
  volumes:
30
- - ./prometheus.yml:/etc/prometheus/prometheus.yml
31
  ports:
32
  - "9090:9090"
33
  networks:
 
17
  ports:
18
  - "80:80"
19
  volumes:
20
+ - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
21
  depends_on:
22
  - app
23
  networks:
 
27
  image: prom/prometheus
28
  container_name: prometheus
29
  volumes:
30
+ - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
31
  ports:
32
  - "9090:9090"
33
  networks:
{config β†’ nginx}/nginx.conf RENAMED
File without changes
prometheus.yml β†’ prometheus/prometheus.yml RENAMED
File without changes