-
Notifications
You must be signed in to change notification settings - Fork 25
60 lines (59 loc) · 1.97 KB
/
run-preflight.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
name: Run Preflight
on: [push]
jobs:
Check-Repogitory:
runs-on: ubuntu-20.04
outputs:
result: ${{ steps.check_repogitory.outputs.is_kube_loxilb }}
steps:
- name: check repository
id: check_repogitory
if: github.repository == 'loxilb-io/kube-loxilb'
run: |
echo "This workflow only runs on the loxilb-io/kube-loxilb repository."
echo "is_kube_loxilb=true" >> $GITHUB_OUTPUT
Run-Preflight:
runs-on: ubuntu-20.04
needs: Check-Repogitory
if: needs.Check-Repogitory.outputs.result == 'true'
permissions:
packages: write
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.0'
- run: make
- run: docker build . --tag ghcr.io/loxilb-io/kube-loxilb-ubi8:preflight -f Dockerfile.RHEL
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: docker push ghcr.io/loxilb-io/kube-loxilb-ubi8:preflight
- run: mkdir -p /tmp/preflight-artifacts
- run: |-
docker run \
-i \
--rm \
--security-opt=label=disable \
--env PFLT_LOGLEVEL=info \
--env PFLT_ARTIFACTS=/artifacts \
-v /tmp/preflight-artifacts:/artifacts \
quay.io/opdev/preflight:stable check container ghcr.io/loxilb-io/kube-loxilb-ubi8:preflight > results.json
- name: get results.json
id: get_results_json
run: |
PASSED=$(cat results.json | jq '.passed')
echo $PASSED
echo "PASSED=$PASSED" >> $GITHUB_OUTPUT
- if: ${{ steps.get_results_json.outputs.PASSED == 'true' }}
run: |
echo "passed: true."
- if: ${{ steps.get_results_json.outputs.PASSED != 'true' }}
run: |
echo "passed: false."
cat results.json
exit 1