|
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - "main" |
| 7 | + - "release/*" |
7 | 8 | pull_request: |
8 | 9 | branches: |
9 | 10 | - "main" |
| 11 | + - "release/*" |
10 | 12 | workflow_call: |
11 | 13 | merge_group: |
12 | 14 |
|
13 | 15 | concurrency: |
14 | | - group: ci-global-${{ github.ref }} |
| 16 | + group: ci-e2e-${{ github.ref }} |
15 | 17 | cancel-in-progress: true |
16 | 18 |
|
17 | 19 | jobs: |
18 | | - build-and-upload-for-global-ci: |
| 20 | + build-and-upload-for-e2e-ci: |
19 | 21 | runs-on: ubuntu-latest |
20 | 22 | steps: |
21 | 23 | - uses: actions/checkout@v5 |
|
32 | 34 | path: /tmp/trustify-ui.tar |
33 | 35 | retention-days: 1 |
34 | 36 |
|
| 37 | + discover-envs-for-e2e-ci: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + outputs: |
| 40 | + image_tag: ${{ steps.set-outputs.outputs.image_tag }} |
| 41 | + steps: |
| 42 | + - name: Extract env vars for main |
| 43 | + shell: bash |
| 44 | + if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'main') || (github.event_name != 'pull_request' && github.ref == 'refs/heads/main') }} |
| 45 | + run: | |
| 46 | + echo "image_tag=latest" >> $GITHUB_ENV |
| 47 | + - name: Extract env vars for other branches on PR |
| 48 | + shell: bash |
| 49 | + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref != 'main' }} |
| 50 | + run: | |
| 51 | + branch=${{ github.event.pull_request.base.ref }} |
| 52 | + branch_version="${branch#release/}" |
| 53 | + echo "image_tag=$branch_version" >> $GITHUB_ENV |
| 54 | + - name: Extract env vars for other branches on Push |
| 55 | + shell: bash |
| 56 | + if: ${{ github.event_name != 'pull_request' && contains(github.ref, 'refs/heads/main') == false }} |
| 57 | + run: | |
| 58 | + branch=$(echo ${GITHUB_REF#refs/heads/}) |
| 59 | + branch_version="${branch#release/}" |
| 60 | + echo "image_tag=$branch_version" >> $GITHUB_ENV |
| 61 | + - name: Set outputs |
| 62 | + id: set-outputs |
| 63 | + run: | |
| 64 | + echo "image_tag=${{ env.image_tag }}" >> "$GITHUB_OUTPUT" |
| 65 | +
|
35 | 66 | run-e2e-ci: |
36 | | - needs: build-and-upload-for-global-ci |
| 67 | + needs: |
| 68 | + - build-and-upload-for-e2e-ci |
| 69 | + - discover-envs-for-e2e-ci |
37 | 70 | uses: ./.github/workflows/ci-e2e-template.yaml |
38 | 71 | with: |
39 | 72 | artifact: trustify-ui |
40 | 73 | ui_image: ghcr.io/trustification/trustify-ui:pr-test |
| 74 | + server_image: ghcr.io/trustification/trustd:${{ needs.discover-envs-for-e2e-ci.outputs.image_tag }} |
0 commit comments