Skip to content

Fix/statement logs

Fix/statement logs #2

name: Publish image to Github container registry
on:
workflow_call: { }
pull_request:
branches:
- master
jobs:
publish-registry:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- spark_version: 3.3.3
hadoop_version: 3
- spark_version: 3.4.1
hadoop_version: 3
- spark_version: 3.5.0
hadoop_version: 3
steps:
- name: Base ref
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "BASE_REF=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
elif [ "${{ github.event_name }}" = "pull_request" ]; then
LOWER_BRANCH=${{ github.event.pull_request.head.ref }}
SLUG_BRANCH=$(echo "$LOWER_BRANCH" | sed -e 's/[^a-zA-Z0-9]/-/g' -e 's/--/-/g')
echo "$SLUG_BRANCH"
echo "BASE_REF=$SLUG_BRANCH" >> $GITHUB_ENV
fi
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v3
with:
push: true
build-args: |
SPARK_VERSION=${{ matrix.spark_version }}
HADOOP_VERSION=${{ matrix.hadoop_version }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BASE_REF }}-spark${{ matrix.spark_version }}