Skip to content

Commit eaa50fc

Browse files
committed
Add dockerhub automation
1 parent 9bf3bff commit eaa50fc

File tree

1 file changed

+54
-23
lines changed

1 file changed

+54
-23
lines changed

.github/workflows/ci.yml

+54-23
Original file line numberDiff line numberDiff line change
@@ -11,45 +11,76 @@ on:
1111
jobs:
1212

1313
frontend:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-latest
1515

16-
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v3
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
1919

20-
- name: Set up Node
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: '20.15.1'
24-
25-
- name: Install dependencies
26-
run: |
27-
cd frontend/
28-
npm install --legacy-peer-deps
20+
- name: Set up Node
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: '20.15.1'
24+
25+
- name: Install dependencies
26+
run: |
27+
cd frontend/
28+
npm install --legacy-peer-deps
2929
30-
- name: Run tests
31-
run: |
32-
cd frontend/
33-
npm test
30+
- name: Run tests
31+
run: |
32+
cd frontend/
33+
npm test
3434
3535
backend:
3636
runs-on: ubuntu-latest
37-
# needs: frontend
3837

3938
steps:
4039
- name: Checkout repository
4140
uses: actions/checkout@v3
4241

43-
- name: Set up go
42+
- name: Set up Go
4443
uses: actions/setup-go@v3
4544
with:
4645
go-version: '1.23'
4746

4847
- name: Install dependencies
4948
run: |
50-
cd backend/
51-
cd api-gateway/
49+
cd backend/api-gateway
5250
go mod download
53-
cd ../
54-
cd code-execution-service/
51+
cd ../code-execution-service
5552
go mod download
53+
54+
dockerhub-update:
55+
runs-on: ubuntu-latest
56+
needs: [frontend, backend]
57+
steps:
58+
- name: Checkout repository
59+
uses: actions/checkout@v3
60+
61+
- name: Logging in to Docker Hub
62+
uses: docker/login-action@v3
63+
with:
64+
username: ${{ vars.DOCKERHUB_USERNAME }}
65+
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
67+
- name: Set up Docker Buildx
68+
uses: docker/setup-buildx-action@v3
69+
70+
- name: Build and push api-gateway image
71+
run: |
72+
cd backend/api-gateway
73+
docker build -t slashex/codebrewery-api-gateway:latest .
74+
docker push slashex/codebrewery-api-gateway:latest
75+
76+
- name: Build and push code-execution-service image
77+
run: |
78+
cd backend/code-execution-service
79+
docker build -t slashex/codebrewery-code-execution-service:latest .
80+
docker push slashex/codebrewery-code-execution-service:latest
81+
82+
- name: Build and push frontend image
83+
run: |
84+
cd frontend
85+
docker build -t slashex/codebrewery-frontend:latest .
86+
docker push slashex/codebrewery-frontend:latest

0 commit comments

Comments
 (0)