Skip to content

Publish Container Image #22

Publish Container Image

Publish Container Image #22

Workflow file for this run

name: "Publish Container Image"
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
tag:
description: "Tag to publish in addition to `latest`"
required: true
type: string
jobs:
publish:
runs-on: ubuntu-24.04
steps:
- uses: actions/[email protected]
- name: Compute Tags
id: compute-tags
run: |
prefix="ghcr.io/jaegertracing/spark-dependencies/spark-dependencies"
tags="$prefix:latest"
if [[ -n "${{ inputs.tag }}" ]]; then
tags="$tags,$prefix:${{ inputs.tag }}"
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
release=$(echo ${{ github.ref }} | sed 's/refs\/tags\///g')
tags="$tags,$prefix:$release"
fi
echo "Computed tags for publication: $tags"
echo "tags=$tags" >> $GITHUB_OUTPUT
- name: Login to GitHub Package Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.compute-tags.outputs.tags }}
platforms: |
linux/amd64
linux/arm64