-
Notifications
You must be signed in to change notification settings - Fork 50
105 lines (94 loc) · 3.59 KB
/
auto-build-base-images.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
97
98
99
100
101
102
103
104
105
name: Scheduled Build Base Images
on:
workflow_dispatch:
# push:
schedule:
# every sunday morning
- cron: '04 2 * * 0'
jobs:
build-base-images:
runs-on: ubuntu-latest
steps:
- name: 'Determine branch name'
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF})" >> $GITHUB_ENV
else
echo "BRANCH_NAME=$(echo ${GITHUB_REF_NAME})" >> $GITHUB_ENV
fi
- name: Build Base Images
uses: zowe-actions/shared-actions/workflow-remote-call-wait@main
id: build-base
with:
github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
owner: zowe
repo: zowe-install-packaging
workflow-filename: base-images.yml
branch-name: ${{ env.BRANCH_NAME }}
poll-frequency: 1
inputs-json-string: '{"release":"true"}'
env:
DEBUG: zowe-actions:*
- name: Exit if build failed
if: ${{ steps.build-base.outputs.workflow-run-conclusion != 'success' }}
uses: actions/github-script@v5
with:
script: |
core.setFailed('Build base images #${{ steps.build-base.outputs.workflow-run-num }} is not successful')
- name: Build Base JDK Images
uses: zowe-actions/shared-actions/workflow-remote-call-wait@main
id: build-jdk-base
with:
github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
owner: zowe
repo: zowe-install-packaging
workflow-filename: base-jdk-images.yml
branch-name: ${{ env.BRANCH_NAME }}
poll-frequency: 1
inputs-json-string: '{"release":"true"}'
env:
DEBUG: zowe-actions:*
- name: Exit if build failed
if: ${{ steps.build-jdk-base.outputs.workflow-run-conclusion != 'success' }}
uses: actions/github-script@v5
with:
script: |
core.setFailed('Build base images #${{ steps.build-jdk-base.outputs.workflow-run-num }} is not successful')
- name: Build Base Node Images
uses: zowe-actions/shared-actions/workflow-remote-call-wait@main
id: build-node-base
with:
github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
owner: zowe
repo: zowe-install-packaging
workflow-filename: base-node-images.yml
branch-name: ${{ env.BRANCH_NAME }}
poll-frequency: 1
inputs-json-string: '{"release":"true"}'
env:
DEBUG: zowe-actions:*
- name: Exit if build failed
if: ${{ steps.build-node-base.outputs.workflow-run-conclusion != 'success' }}
uses: actions/github-script@v5
with:
script: |
core.setFailed('Build base images #${{ steps.build-node-base.outputs.workflow-run-num }} is not successful')
- name: Scan images
uses: zowe-actions/shared-actions/workflow-remote-call-wait@main
id: scan-released-images
with:
github-token: ${{ secrets.ZOWE_ROBOT_TOKEN }}
owner: zowe
repo: zowe-install-packaging
workflow-filename: snyk-analysis.yml
branch-name: ${{ env.BRANCH_NAME }}
poll-frequency: 1
inputs-json-string: '{}'
env:
DEBUG: zowe-actions:*
- name: Exit if build failed
if: ${{ steps.scan-released-images.outputs.workflow-run-conclusion != 'success' }}
uses: actions/github-script@v5
with:
script: |
core.setFailed('Build base images #${{ steps.scan-released-images.outputs.workflow-run-num }} is not successful')