1010 - main
1111
1212jobs :
13- determine_tag :
14- name : Determines Image Tag
15- runs-on : ubuntu-latest
16- # Map a step output to a job output
17- outputs :
18- image_tag : ${{ steps.meta.outputs.version }}
19- image_json : ${{ steps.meta.outputs.json }}
20- steps :
21- - name : Determines Image Tag
22- id : meta
23- uses : docker/metadata-action@v3
24- with :
25- images : inoeg/iris-client-bff,inoeg/iris-client-frontend
26-
2713 skip_check :
2814 name : Determines Job skipping
2915 continue-on-error : true # Uncomment once integration is finished
@@ -52,23 +38,47 @@ jobs:
5238 paths_ignore : ' ["**/README.md", "**/Readme.md", "**/docs/**", "**/postman/**"]'
5339 paths : ' [".github/workflows/fe_develop.yml", "iris-client-fe/**"]'
5440
55- test :
56- name : Test
57- needs : [determine_tag, skip_check]
41+ determine_images :
42+ name : Determines Relevant Images
43+ needs : skip_check
5844 runs-on : ubuntu-latest
45+ outputs :
46+ images : ${{ env.IMAGES }}
5947 steps :
60- - name : Output
48+ - id : step
49+ name : Determines Relevant Images
6150 run : |
62- echo $SKIP_BFF
63- echo $IMAGE_JSON
64- env :
65- SKIP_BFF : ${{ needs.skip_check.outputs.should_skip_bff }}
66- IMAGE_JSON : ${{ needs.determine_tag.outputs.image_json }}
51+ declare -a image_array
52+
53+ if [ ${{ needs.skip_check.outputs.should_skip_bff }} != 'true' ]; then
54+ image_array+=(inoeg/iris-client-bff)
55+ fi
56+ if [ ${{ needs.skip_check.outputs.should_skip_fe }} != 'true' ]; then
57+ image_array+=(inoeg/iris-client-frontend)
58+ fi
59+
60+ echo "IMAGES=$(IFS=,; echo "${image_array[*]}")" >> $GITHUB_ENV
61+ # echo "tags=$(echo $IMAGE_JSON | jq -c '[.tags[] | select(test("bff|fr"))]')" >> $GITHUB_ENV
6762
63+ determine_tag :
64+ name : Determines Image Tag
65+ needs : determine_images
66+ runs-on : ubuntu-latest
67+ # Map a step output to a job output
68+ outputs :
69+ image_tag : ${{ steps.step.outputs.version }}
70+ image_json : ${{ steps.step.outputs.json }}
71+ steps :
72+ - name : Determines Image Tag
73+ id : step
74+ uses : docker/metadata-action@v3
75+ with :
76+ images : ${{needs.determine_images.outputs.images}}
77+
6878 bff :
6979 name : Build BFF
70- needs : [determine_tag, skip_check ]
71- if : ${{ needs.skip_check.outputs.should_skip_bff ! = 'true' }}
80+ needs : [skip_check, determine_tag ]
81+ if : ${{ needs.skip_check.outputs.should_skip_bff = = 'true' }}
7282 uses : iris-connect/iris-client/.github/workflows/bff_develop.yml@chore/optimized_build
7383 with :
7484 image_tag : ${{needs.determine_tag.outputs.image_tag}}
@@ -81,28 +91,36 @@ jobs:
8191 needs : bff
8292 # the previous job might be skipped, we don't need to run this job then
8393 if : success() || failure()
84- uses : iris-connect/iris-client/.github/workflows/publish-test-results.yml@develop
94+ uses : iris-connect/iris-client/.github/workflows/publish-test-results.yml@chore/optimized_build
8595
8696 fe :
8797 name : Build FE
88- needs : [determine_tag, skip_check ]
89- if : ${{ needs.skip_check_fe .outputs.should_skip_fe != 'true' }}
98+ needs : [skip_check, determine_tag ]
99+ if : ${{ needs.skip_check .outputs.should_skip_fe != 'true' }}
90100 uses : iris-connect/iris-client/.github/workflows/fe_develop.yml@chore/optimized_build
91101 with :
92102 image_tag : ${{needs.determine_tag.outputs.image_tag}}
93103 secrets :
94104 DOCKER_HUB_USER : ${{ secrets.DOCKER_HUB_USER }}
95105 DOCKER_HUB_PW : ${{ secrets.DOCKER_HUB_PW }}
96106
97- e2e_test :
98- name : Run E2E Tests
99- needs : [bff, fe]
100- if : ${{ always () && contains(needs.*.result, 'success' ) && !contains(needs.*.result, 'failure' ) }}
101- uses : iris-connect/iris-client/.github/workflows/fe-e2e-test.yml@chore/optimized_build
107+ # e2e_test:
108+ # name: Run E2E Tests
109+ # needs: [bff, fe]
110+ # if: ${{ !failure () && !cancelled( ) && (success('bff') || success('fe') ) }}
111+ # uses: iris-connect/iris-client/.github/workflows/fe-e2e-test.yml@chore/optimized_build
102112
103113 container_scan :
104114 name : Container Scan
105115 needs : [determine_tag, bff, fe]
106- uses : iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@develop
116+ uses : iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@chore/optimized_build
117+ with :
118+ image-refs : ${{ toJSON(fromJSON(needs.determine_tag.outputs.image_json).tags) }}
119+
120+ container_scan2 :
121+ name : Container Scan 2
122+ needs : [determine_tag, bff, fe]
123+ if : ${{ success() }}
124+ uses : iris-connect/iris-client/.github/workflows/trivy-container-scan.yml@chore/optimized_build
107125 with :
108126 image-refs : ${{ toJSON(fromJSON(needs.determine_tag.outputs.image_json).tags) }}
0 commit comments