This repository has been archived by the owner on Jan 24, 2025. It is now read-only.
generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 19
96 lines (93 loc) · 3.46 KB
/
kyma-dashboard-stage-build.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Build Kyma Dashboard Stage Images
on:
pull_request_target:
types: [opened, edited, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/kyma-dashboard-stage-build.yml"
- "Dockerfile.*"
- "package.json"
- "environments/stage/**"
- "extensions/**"
- "gulpfile.js"
- "Makefile"
- "tests/cypress-smoke.json"
- "tests/tests/**/test-check-extensions.spec.js"
push:
branches:
- main
paths:
- ".github/workflows/kyma-dashboard-stage-build.yml"
- "Dockerfile.*"
- "package.json"
- "environments/stage/**"
- "extensions/**"
- "gulpfile.js"
- "Makefile"
- "tests/cypress-smoke.json"
- "tests/tests/**/test-check-extensions.spec.js"
permissions:
id-token: write # This is required for requesting the JWT token
contents: read # This is required for actions/checkout
jobs:
load-env-stage:
runs-on: ubuntu-latest
outputs:
WEB_IMAGE: ${{ steps.get_tags.outputs.WEB_IMAGE }}
BACKEND_IMAGE: ${{ steps.get_tags.outputs.BACKEND_IMAGE }}
LOCAL_IMAGE: ${{ steps.get_tags.outputs.LOCAL_IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load environment variables
id: get_tags
run: |
source ./environments/stage/env.sh
echo "WEB_IMAGE=$WEB_IMAGE" >> $GITHUB_OUTPUT
echo "BACKEND_IMAGE=$BACKEND_IMAGE" >> $GITHUB_OUTPUT
echo "LOCAL_IMAGE=$LOCAL_IMAGE" >> $GITHUB_OUTPUT
build-web-stage:
needs: [ load-env-stage ]
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: kyma-dashboard-web-stage # This image name is used to build the URL to the registry
dockerfile: Dockerfile.web
context: .
export-tags: true
tags: latest
build-args: |
ENV=stage
WEB_IMAGE=${{ needs.load-env-stage.outputs.WEB_IMAGE }}
build-backend-stage:
needs: [ load-env-stage ]
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: kyma-dashboard-backend-stage # This image name is used to build the URL to the registry
dockerfile: Dockerfile.backend
context: .
export-tags: true
tags: latest
build-args: |
ENV=stage
BACKEND_IMAGE=${{ needs.load-env-stage.outputs.BACKEND_IMAGE }}
build-local-stage:
needs: [ load-env-stage ]
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main # Usage: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: kyma-dashboard-local-stage # This image name is used to build the URL to the registry
dockerfile: Dockerfile.local
context: .
export-tags: true
tags: latest
build-args: |
ENV=stage
LOCAL_IMAGE=${{ needs.load-env-stage.outputs.LOCAL_IMAGE }}
test-images-stage:
runs-on: ubuntu-latest
needs: [ build-web-stage, build-backend-stage, build-local-stage ]
steps:
- name: Test web image
run: echo "Testing web images ${{ needs.build-web-stage.outputs.images }}"
- name: Test backend image
run: echo "Testing backend images ${{ needs.build-backend-stage.outputs.images }}"
- name: Test local image
run: echo "Testing local images ${{ needs.build-local-stage.outputs.images }}"