Skip to content

Merge/exec arg wildcards #19

Merge/exec arg wildcards

Merge/exec arg wildcards #19

Workflow file for this run

name: Build sign-object image
on:
push:
branches: [main, feat/signature-verification]
paths:
- 'cmd/sign-object/**'
- 'pkg/signature/**'
- 'pkg/signature/profiles/**'
- 'go.mod'
- 'go.sum'
pull_request:
paths:
- 'cmd/sign-object/**'
- 'pkg/signature/**'
- 'pkg/signature/profiles/**'
workflow_dispatch:
inputs:
IMAGE_TAG:
required: false
type: string
default: 'latest'
description: 'Image tag for the sign-object image'
permissions:
packages: write
contents: read
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/sign-object
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set image tag
id: tag
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.IMAGE_TAG }}" ]; then
echo "tag=${{ inputs.IMAGE_TAG }}" >> "$GITHUB_OUTPUT"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
echo "tag=pr-${{ github.event.number }}" >> "$GITHUB_OUTPUT"
else
echo "tag=latest" >> "$GITHUB_OUTPUT"
fi
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: .
file: cmd/sign-object/Dockerfile
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.tag }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}