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

alignment #10

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 5 additions & 7 deletions .github/workflows/docker-custom-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'openshift/builds/docker/Dockerfile'
pull_request:
branches:
- '!main'
- 'main'
paths:
- 'openshift/builds/docker/Dockerfile'

Expand All @@ -20,18 +20,16 @@ env:

jobs:

docker-linter:
uses: ocpdude/reusable/.github/workflows/linter.yaml@main
with:
language: hadolint
super-linter:
uses: .github/workflows/super-linter.yaml@main

security-checks:
permissions:
contents: read
security-events: write
actions: read
runs-on: ubuntu-latest
needs: [ docker-linter ]
needs: [ super-linter ]
steps:
- uses: actions/checkout@v4
- name: Build the test image
Expand All @@ -50,7 +48,7 @@ jobs:
sarif_file: ${{ steps.scan.outputs.sarif }}

build-deployment:
needs: [ security-checks, docker-linter ]
needs: [ security-checks, super-linter ]
runs-on: ubuntu-latest
steps:
- name: Get the date
Expand Down
99 changes: 49 additions & 50 deletions .github/workflows/podman-custom-runner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,71 @@ name: Podman Custom Runner
on:
push:
branches:
- main
- main
paths:
- '.openshift/builds/podman/Dockerfile'
- 'openshift/builds/podman/Dockerfile'
pull_request:
branches:
- 'main'
paths:
- 'openshift/builds/podman/Dockerfile'

workflow_dispatch:

env:
REGISTRY: ghcr.io
# FILTER_REGEX_EXCLUDE: ./builds/actions-custom-runner/.*

jobs:

docker-linter:
uses: ocpdude/reusable/.github/workflows/linter.yaml@main
with:
language: hadolint

security-checks:
permissions:
contents: read
security-events: write
actions: read
runs-on: ubuntu-latest
needs: [ docker-linter ]
steps:
- uses: actions/checkout@v4
- name: Build the test image
working-directory: ./openshift/builds/podman/
run: docker build . --tag localbuild/testimage:latest
- name: Grype scan the test image
uses: anchore/scan-action@v3
id: scan
with:
image: "localbuild/testimage:latest"
fail-build: false
severity-cutoff: critical
- name: Upload vulnerability report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
- uses: actions/checkout@v4
- name: Build the test image
working-directory: ./openshift/builds/podman/
run: docker build . --tag localbuild/testimage:latest
- name: Grype scan the test image
uses: anchore/scan-action@v3
id: scan
with:
image: "localbuild/testimage:latest"
fail-build: false
severity-cutoff: critical
- name: Upload vulnerability report
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

build-deployment:
needs: [ security-checks, docker-linter ]
needs: [ security-checks ]
runs-on: ubuntu-latest
steps:
- name: Get the date
id: date
run: echo "::set-output name=date::$(date +'%m%d')"
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./openshift/builds/podman/
platforms: linux/amd64
push: true
tags: |
${{env.REGISTRY}}/ocpdude/podman-runner:${{ steps.date.outputs.date }}
${{env.REGISTRY}}/ocpdude/podman-runner:latest

- name: Get the date
id: date
run: echo "::set-output name=date::$(date +'%m%d')"
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./openshift/builds/podman/
platforms: linux/amd64
push: true
tags: |
${{env.REGISTRY}}/ocpdude/podman-runner:${{ steps.date.outputs.date }}
${{env.REGISTRY}}/ocpdude/podman-runner:latest
24 changes: 11 additions & 13 deletions .github/workflows/super-linter.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
name: Code Linter

on:
# push:
# branches:
# - main
pull_request:
branches:
- '!main'
paths:
- './openshift/manifests/org-ocpdude/**.yaml'
- './openshift/manifests/org-vault-tec/**.yaml'
- './openshift/manifests/rbac-example/**.yaml'
- './openshift/builds/podman/Dockerfile'
- './openshift/builds/docker/Dockerfile'

workflow_call:
workflow_dispatch:
pull_request:
branches:
- 'main'
paths:
- 'openshift/manifests/org-ocpdude/**.yaml'
- 'openshift/manifests/org-vault-tec/**.yaml'
- 'openshift/manifests/rbac-example/**.yaml'
- 'openshift/builds/podman/Dockerfile'
- 'openshift/builds/docker/Dockerfile'


jobs:
build:
Expand Down
2 changes: 0 additions & 2 deletions openshift/builds/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ RUN sudo apt-get update -y \

USER root

# remove this test comment

# Adding certs for my lab to the runner
# COPY ca.crt /usr/local/share/ca-certificates/ca.crt
# RUN update-ca-certificates
Expand Down