Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create run-preflight.yml #10

Merged
merged 1 commit into from
Jun 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/run-preflight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Run Preflight
on: [push]
jobs:
Run-Preflight:
runs-on: ubuntu-20.04
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
- name: get results.json
id: get_results_json
run: |
PASSED=$(cat /tmp/preflight-artifacts/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 /tmp/preflight-artifacts/results.json
exit 1