Skip to content

Commit

Permalink
feat: Add container check CI job
Browse files Browse the repository at this point in the history
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
  • Loading branch information
mateusoliveira43 committed Nov 22, 2024
1 parent 56e8901 commit d381bba
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Container Check

on:
push:
paths-ignore:
- '**/*.md'
pull_request:
paths-ignore:
- '**/*.md'

jobs:
container-check:
runs-on: ubuntu-latest
if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository)
steps:
- name: Clone the code
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '~1.22'

- name: Prepare project-v4
working-directory: testdata/project-v4
run: go mod tidy

- name: Build and push container image
working-directory: testdata/project-v4
run: IMG=ttl.sh/kubebuilder-container-check-$(git rev-parse --short HEAD):5m make docker-build docker-push

- name: Build and push container image with buildx
working-directory: testdata/project-v4
run: IMG=ttl.sh/kubebuilder-container-buildx-check-$(git rev-parse --short HEAD):5m make docker-buildx

- name: Container file linter
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: testdata/project-v4/Dockerfile

0 comments on commit d381bba

Please sign in to comment.