Merge branch 'main' of https://github.com/nmaguiar/imgutils #286
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: '37 1 * * 6' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Cache dive | |
uses: actions/cache@v4 | |
with: | |
key : dive | |
path: | | |
dive_linux_* | |
- name: Cache skopeo | |
uses: actions/cache@v4 | |
with: | |
key : skopeo | |
path: | | |
skopeo_* | |
- name: list dive | |
run : | | |
arch=$(uname -m) && if [ "$arch" == "aarch64" ]; then cp dive_linux_arm64 dive; elif [ "$arch" == "x86_64" ]; then cp dive_linux_amd64 dive; fi | |
- name: list skopeo | |
run : | | |
arch=$(uname -m) && if [ "$arch" == "aarch64" ]; then cp skopeo_arm64 skopeo; elif [ "$arch" == "x86_64" ]; then cp skopeo_amd64 skopeo; fi | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: docker/build-push-action@v3 | |
name: Build and push | |
with: | |
context: . | |
file: ./Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
tags: nmaguiar/imgutils:build | |
# - uses: docker/build-push-action@v3 | |
# name: Build and push ubi | |
# with: | |
# platforms: linux/amd64,linux/arm64 | |
# file: Dockerfile.ubi | |
# push: true | |
# tags: nmaguiar/imgutils:ubi-build | |
test-skopeo: | |
name : test skopeo | |
runs-on: ubuntu-latest | |
needs : build | |
steps : | |
- uses: actions/checkout@v4 | |
- name: Test skopeo inspect | |
uses: ./ | |
with: | |
cmd: sudo skopeo inspect docker://nmaguiar/imgutils:build > /dev/null | |
test-helm: | |
name : test helm | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test helm | |
uses: ./ | |
with: | |
cmd: sudo helm repo add bitnami https://charts.bitnami.com/bitnami && sudo helm pull bitnami/nginx | |
test-docker: | |
name : test docker | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test docker | |
uses: ./ | |
with: | |
cmd: docker run --rm nmaguiar/imgutils:build id | |
test-crictl: | |
name : test crictl | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test crictl | |
uses: ./ | |
with: | |
cmd: crictl -v | |
test-ctr: | |
name : test ctr | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test ctr | |
uses: ./ | |
with: | |
cmd: ctr -v | |
test-nerdctl: | |
name : test nerdctl | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test nerdctl | |
uses: ./ | |
with: | |
cmd: nerdctl -v | |
test-openaf: | |
name : test openaf | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test openaf | |
uses: ./ | |
with: | |
cmd: oaf -v | |
test-syft: | |
name : test syft | |
runs-on: ubuntu-latest | |
needs : build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Test syft | |
uses: ./ | |
with: | |
cmd: sudo syft scan nmaguiar/imgutils -o syft-table > /dev/null |