From f6d847f0e77e0bc561bd35b39aca1808e90eab45 Mon Sep 17 00:00:00 2001 From: backguynn <88170638+backguynn@users.noreply.github.com> Date: Fri, 16 Jun 2023 16:02:45 +0900 Subject: [PATCH] Create run-preflight.yml --- .github/workflows/run-preflight.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/run-preflight.yml diff --git a/.github/workflows/run-preflight.yml b/.github/workflows/run-preflight.yml new file mode 100644 index 0000000..6992a38 --- /dev/null +++ b/.github/workflows/run-preflight.yml @@ -0,0 +1,44 @@ +name: Run Preflight +on: [push] +jobs: + Run-Preflight: + runs-on: ubuntu-20.04 + 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@v1 + 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