Skip to content

Commit 95d2513

Browse files
committed
add ci/cd
1 parent 59f1541 commit 95d2513

File tree

2 files changed

+38
-3
lines changed

2 files changed

+38
-3
lines changed

.github/workflows/build-and-push.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Proiect IDP 2024
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Log in to Docker Hub
17+
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
18+
19+
- name: Build auth-server Docker image
20+
run: docker build --no-cache -t ${{ secrets.DOCKERHUB_USERNAME }}/auth-server:latest -f ./auth-server/Dockerfile .
21+
22+
- name: Build io-service Docker image
23+
run: docker build --no-cache -t ${{ secrets.DOCKERHUB_USERNAME }}/io-service:latest -f ./io-service/Dockerfile .
24+
25+
- name: Build business-service Docker image
26+
run: docker build --no-cache -t ${{ secrets.DOCKERHUB_USERNAME }}/business-service:latest -f ./business-service/Dockerfile .
27+
28+
- name: Push auth-server Docker image to Docker Hub
29+
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/auth-server:latest
30+
31+
- name: Push io-service Docker image to Docker Hub
32+
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/io-service:latest
33+
34+
- name: Push business-service Docker image to Docker Hub
35+
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/business-service:latest

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Build Docker images
22
build-auth:
3-
docker build --no-cache -t auth-server -f ./auth-server/Dockerfile ./auth-server
3+
docker build --no-cache -t auth-server -f ./auth-server/Dockerfile .
44

55
build-io:
6-
docker build --no-cache -t io-service -f ./io-service/Dockerfile ./io-service
6+
docker build --no-cache -t io-service -f ./io-service/Dockerfile .
77

88
build-business:
9-
docker build --no-cache -t business-service -f ./business-service/Dockerfile ./business-service
9+
docker build --no-cache -t business-service -f ./business-service/Dockerfile .
1010

1111
build: build-auth build-io build-busines
1212

0 commit comments

Comments
 (0)