-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (55 loc) · 2.18 KB
/
docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Build and push services
on:
push:
branches:
- dev
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# 1. Checkout repository
- name: Checkout code
uses: actions/checkout@v4
# 2. Login to DockerHub
- name: Login to DockerHub Registry
run: echo ${{secrets.DOCKERHUB_TOKEN}} | docker login -u ${{secrets.DOCKERHUB_USERNAME}} --password-stdin
# 3. Build ads_service
- name: Build and push ads_service
uses: docker/build-push-action@v4
with:
context: .
file: ./microservices/ads_service/Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/ads_service:latest
push: true
# 4. Build auth_service
- name: Build and push auth_service
uses: docker/build-push-action@v4
with:
context: .
file: ./microservices/auth_service/Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/auth_service:latest
push: true
# 5. Build city_service
- name: Build and push city_service
uses: docker/build-push-action@v4
with:
context: .
file: ./microservices/city_service/Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/city_service:latest
push: true
# 6. Build migrator
- name: Build and push migrator
uses: docker/build-push-action@v4
with:
context: .
file: ./cmd/migrator/Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/migrator:latest
push: true
# 7. Build backend (main service)
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
tags: ${{secrets.DOCKERHUB_USERNAME}}/backend:latest
push: true