forked from guacsec/trustify-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (72 loc) · 2.3 KB
/
ci-e2e.yaml
File metadata and controls
79 lines (72 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: CI (e2e)
on:
push:
branches:
- "main"
- "release/*"
pull_request:
branches:
- "main"
- "release/*"
workflow_call:
merge_group:
concurrency:
group: ci-e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-upload-for-e2e-ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: save trustify-ui image
run: |
docker build . -t ghcr.io/guacsec/trustify-ui:pr-test -f Dockerfile
docker save -o /tmp/trustify-ui.tar ghcr.io/guacsec/trustify-ui:pr-test
- name: Upload trustify-ui image as artifact
uses: actions/upload-artifact@v4
with:
name: trustify-ui
path: /tmp/trustify-ui.tar
retention-days: 1
discover-envs-for-e2e-ci:
runs-on: ubuntu-latest
outputs:
image_tag: ${{ steps.set-outputs.outputs.image_tag }}
steps:
- name: Extract vars for Pull Request
shell: bash
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
env:
base_ref: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }}
run: |
branch=$base_ref
branch=$(echo ${branch#refs/heads/})
image_tag="latest"
if [[ "$branch" != "main" ]]; then
image_tag="${branch#release/}"
fi
echo "image_tag=$image_tag" >> $GITHUB_ENV
- name: Extract vars for Push
shell: bash
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
run: |
branch=$(echo ${GITHUB_REF#refs/heads/})
image_tag="latest"
if [[ "$branch" != "main" ]]; then
image_tag="${branch#release/}"
fi
echo "image_tag=$image_tag" >> $GITHUB_ENV
- name: Set outputs
id: set-outputs
run: |
echo ${{ env.image_tag }}
echo "image_tag=${{ env.image_tag }}" >> "$GITHUB_OUTPUT"
run-e2e-ci:
needs:
- build-and-upload-for-e2e-ci
- discover-envs-for-e2e-ci
uses: ./.github/workflows/ci-e2e-template.yaml
with:
artifact: trustify-ui
ui_image: ghcr.io/guacsec/trustify-ui:pr-test
server_image: ghcr.io/guacsec/trustd:${{ needs.discover-envs-for-e2e-ci.outputs.image_tag }}