generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 23
51 lines (47 loc) · 1.32 KB
/
build-sample-app-image.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
name: Build Sample App Image
on:
pull_request_target:
paths:
- "docs/user/integration/sample-app/**"
types: [ opened, edited, synchronize, reopened, ready_for_review ]
push:
branches:
- main
- sample-app
paths:
- "docs/user/integration/sample-app/**"
workflow_dispatch:
jobs:
envs:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.create-tags.outputs.tags }}
steps:
- name: create tags
id: create-tags
run: |
if [[ $GITHUB_EVENT_NAME == 'push' || $GITHUB_EVENT_NAME == 'merge_group' ]]; then
echo 'TAGS=latest' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
echo 'PR-${{ github.event.pull_request.number }}'
echo '${{ github.event.pull_request.head.sha }}'
echo 'TAGS'
} >> "$GITHUB_OUTPUT"
fi
build-image:
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: samples/telemetry-sample-app
dockerfile: Dockerfile
context: docs/user/integration/sample-app
tags: ${{ needs.envs.outputs.tags }}
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: List images
run: |
echo "${{ needs.build-image.outputs.images }}"