Skip to content

Commit 1e3506f

Browse files
committed
Update CI workflow: re-enable build and push Docker images job with proper configuration
1 parent eb3f79d commit 1e3506f

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

.github/workflows/ci-build.yml

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ env:
2525
jobs:
2626
# ===== Testing & code checking ======
2727
tests-linting:
28+
name: "Run Lint & All Tests"
2829
runs-on: ubuntu-latest
2930
outputs:
3031
imageTag: ${{ steps.createTag.outputs.IMAGE_TAG }}
@@ -92,26 +93,27 @@ jobs:
9293
reporter: java-junit
9394

9495
# ===== Build container images ======
95-
# build-images:
96-
# runs-on: ubuntu-latest
97-
# needs: tests-linting
98-
# strategy:
99-
# matrix:
100-
# serviceName: [cart, orders, users, products, frontend]
101-
102-
# steps:
103-
# - name: "Checkout source"
104-
# uses: actions/checkout@v3
105-
106-
# - name: "Run build"
107-
# run: |
108-
# make docker-build-${{ matrix.serviceName }} IMAGE_TAG=$IMAGE_TAG VERSION=$VERSION BUILD_INFO="$BUILD_INFO"
109-
# make docker-build-${{ matrix.serviceName }} IMAGE_TAG=latest VERSION=$VERSION BUILD_INFO="$BUILD_INFO"
110-
111-
# # Steps after this are only run when merging or pushing into main
112-
# - name: "Push to container registry"
113-
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
114-
# run: |
115-
# echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REG -u $GITHUB_ACTOR --password-stdin
116-
# make docker-push-${{ matrix.serviceName }} IMAGE_TAG=$IMAGE_TAG
117-
# make docker-push-${{ matrix.serviceName }} IMAGE_TAG=latest
96+
build-images:
97+
name: "Build & Push Docker Images"
98+
runs-on: ubuntu-latest
99+
needs: tests-linting
100+
strategy:
101+
matrix:
102+
serviceName: [cart, orders, users, products, frontend]
103+
104+
steps:
105+
- name: "Checkout source"
106+
uses: actions/checkout@v3
107+
108+
- name: "Run build"
109+
run: |
110+
make docker-build-${{ matrix.serviceName }} IMAGE_TAG=$IMAGE_TAG VERSION=$VERSION BUILD_INFO="$BUILD_INFO"
111+
make docker-build-${{ matrix.serviceName }} IMAGE_TAG=latest VERSION=$VERSION BUILD_INFO="$BUILD_INFO"
112+
113+
# Steps after this are only run when merging or pushing into main
114+
- name: "Push to container registry"
115+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
116+
run: |
117+
echo ${{ secrets.GITHUB_TOKEN }} | docker login $IMAGE_REG -u $GITHUB_ACTOR --password-stdin
118+
make docker-push-${{ matrix.serviceName }} IMAGE_TAG=$IMAGE_TAG
119+
make docker-push-${{ matrix.serviceName }} IMAGE_TAG=latest

0 commit comments

Comments
 (0)