|
31 | 31 | PYTHON_BASE_IMAGE: "python:3.10.8-slim-bullseye" |
32 | 32 | DATAVISYN_PYTHON_BASE_IMAGE: "188237246440.dkr.ecr.eu-central-1.amazonaws.com/datavisyn/base/python:main" |
33 | 33 | DATAVISYN_NGINX_BASE_IMAGE: "188237246440.dkr.ecr.eu-central-1.amazonaws.com/datavisyn/base/nginx:main" |
| 34 | + ARGOCD_DEPLOYED_APP: false |
34 | 35 |
|
35 | 36 | permissions: |
36 | 37 | id-token: write |
|
83 | 84 | with: |
84 | 85 | branch_name: ${{ github.ref_name }} |
85 | 86 | time_zone: ${{ env.TIME_ZONE }} |
| 87 | + - name: Check if app deployed by ArgoCD |
| 88 | + id: argocd-deployed-app |
| 89 | + run: | |
| 90 | + result=$(jq '.apps | index("${{ steps.get-parameters.outputs.app }}") != null' ./.github/argocd-deployed-apps.json) |
| 91 | + if [ "$result" = "true" ]; then |
| 92 | + echo "ARGOCD_DEPLOYED_APP=true" >> $GITHUB_ENV |
| 93 | + else |
| 94 | + echo "ARGOCD_DEPLOYED_APP=false" >> $GITHUB_ENV |
| 95 | + fi |
86 | 96 | build-single: |
87 | 97 | needs: prepare-build |
88 | 98 | if: ${{ needs.prepare-build.outputs.create_workspace != 'true' && needs.prepare-build.outputs.components != '[]' && needs.prepare-build.outputs.components != ''}} |
@@ -124,12 +134,14 @@ jobs: |
124 | 134 | ref: ${{ env.WORKFLOW_BRANCH }} |
125 | 135 | path: ./tmp/github-workflows |
126 | 136 | - name: retag images |
127 | | - run: | |
128 | | - echo "Image Tag 1: ${{ needs.prepare-build.outputs.image_tag1 }}" |
129 | | - echo "Image Tag 2: ${{ needs.prepare-build.outputs.image_tag2 }}" |
130 | | - echo "Stage: ${{ needs.prepare-build.outputs.stage }}" |
131 | | - echo "Components: ${{ needs.prepare-build.outputs.components }}" |
132 | | - echo "app: ${{ needs.prepare-build.outputs.app }}" |
| 137 | + if: ${{ env.ARGOCD_DEPLOYED_APP == 'false' }} |
| 138 | + uses: ./tmp/github-workflows/.github/actions/retag-image |
| 139 | + with: |
| 140 | + aws_role: ${{ vars.DV_AWS_ECR_ROLE }} |
| 141 | + aws_region: ${{ vars.DV_AWS_REGION }} |
| 142 | + ecr_repositories: ${{ needs.prepare-build.outputs.ecr_repos }} |
| 143 | + current_image_tag: ${{ needs.prepare-build.outputs.image_tag1 }} |
| 144 | + additional_image_tag: ${{ needs.prepare-build.outputs.image_tag2 }} |
133 | 145 |
|
134 | 146 | deploy: |
135 | 147 | needs: [prepare-build, post-build] |
|
0 commit comments