Update test-image.yml #275
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 |