Skip to content

Commit

Permalink
buildx param for docker hub
Browse files Browse the repository at this point in the history
Signed-off-by: Brian DeHamer <bdehamer@github.com>
  • Loading branch information
bdehamer committed May 15, 2024
1 parent 7f12f6a commit 8a48ffe
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/oci-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Attest Image (Docker Hub)

on:
workflow_dispatch:
inputs:
buildx:
description: 'Use docker buildx'
type: boolean
required: false
default: true

jobs:
build-image-dockerhub:
Expand All @@ -16,28 +22,36 @@ jobs:
steps:
- name: Build artifact
run: date > artifact.bin

- name: Build Dockerfile
run: |
cat <<EOF > Dockerfile
FROM scratch
COPY artifact.bin .
EOF
- name: Set up QEMU
if: inputs.buildx
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
if: inputs.buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v5.0.0
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

- name: Attest artifact
uses: actions/attest-build-provenance@v1
with:
Expand Down

0 comments on commit 8a48ffe

Please sign in to comment.