Skip to content

Commit 41c36e7

Browse files
committed
add microservices to release workflow
1 parent 4d55ff2 commit 41c36e7

File tree

1 file changed

+59
-7
lines changed

1 file changed

+59
-7
lines changed

.github/workflows/release.yml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ name: release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
tags:
6+
- "v*"
77

88
env:
9-
MOVIES_IMAGE_NAME: 'cinema-movies'
9+
BOOKINGS_IMAGE_NAME: "cinema-bookings"
10+
MOVIES_IMAGE_NAME: "cinema-movies"
11+
SHOWTIMES_IMAGE_NAME: "cinema-showtimes"
12+
USERS_IMAGE_NAME: "cinema-users"
13+
WEBSITE_IMAGE_NAME: "cinema-website"
1014

1115
jobs:
1216
multi-registries:
13-
name: 'Build'
17+
name: "Build"
1418
runs-on: ubuntu-latest
1519
steps:
1620
# setups
@@ -20,7 +24,7 @@ jobs:
2024
uses: docker/setup-buildx-action@v2
2125
- name: Login to DockerHub
2226
uses: docker/login-action@v2
23-
with:
27+
with:
2428
username: ${{ secrets.DOCKERHUB_USERNAME_2 }}
2529
password: ${{ secrets.DOCKERHUB_TOKEN_2 }}
2630
- name: Login to GitHub Container Registry
@@ -32,8 +36,20 @@ jobs:
3236
- name: Get the version
3337
id: get_version
3438
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
35-
36-
# build and push each microservice release
39+
40+
# bookings microservice
41+
- name: Build and push bookings microservice
42+
uses: docker/build-push-action@v3
43+
with:
44+
push: true
45+
context: ./bookings
46+
platforms: linux/amd64,linux/arm/v7,linux/arm64
47+
file: ./bookings/Dockerfile
48+
tags: |
49+
mikebellcoder/${{ env.BOOKINGS_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
50+
ghcr.io/mikebellcoder/${{ env.BOOKINGS_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
51+
52+
# movies microservice
3753
- name: Build and push movies microservice
3854
uses: docker/build-push-action@v3
3955
with:
@@ -44,3 +60,39 @@ jobs:
4460
tags: |
4561
mikebellcoder/${{ env.MOVIES_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
4662
ghcr.io/mikebellcoder/${{ env.MOVIES_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
63+
64+
# showtimes microservice
65+
- name: Build and push showtimes microservice
66+
uses: docker/build-push-action@v3
67+
with:
68+
push: true
69+
context: ./showtimes/
70+
platforms: linux/amd64,linux/arm/v7,linux/arm64
71+
file: ./showtimes/Dockerfile
72+
tags: |
73+
mikebellcoder/${{ env.SHOWTIMES_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
74+
ghcr.io/mikebellcoder/${{ env.SHOWTIMES_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
75+
76+
# users microservice
77+
- name: Build and push users microservice
78+
uses: docker/build-push-action@v3
79+
with:
80+
push: true
81+
context: ./users/
82+
platforms: linux/amd64,linux/arm/v7,linux/arm64
83+
file: ./users/Dockerfile
84+
tags: |
85+
mikebellcoder/${{ env.USERS_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
86+
ghcr.io/mikebellcoder/${{ env.USERS_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
87+
88+
# website microservice
89+
- name: Build and push website microservice
90+
uses: docker/build-push-action@v3
91+
with:
92+
push: true
93+
context: ./website/
94+
platforms: linux/amd64,linux/arm/v7,linux/arm64
95+
file: ./website/Dockerfile
96+
tags: |
97+
mikebellcoder/${{ env.WEBSITE_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}
98+
ghcr.io/mikebellcoder/${{ env.WEBSITE_IMAGE_NAME }}:${{ steps.get_version.outputs.VERSION }}

0 commit comments

Comments
 (0)