feat: set-image-name

This commit is contained in:
Leandro Costa 2025-06-21 18:12:46 -03:00
parent 4a01570b5f
commit 983dbaca67
3 changed files with 17 additions and 59 deletions

View file

@ -0,0 +1,17 @@
name: Forgejo Set Image Name
description: Define IMAGE_NAME to Git Hub env, based on repository name
runs:
using: composite
steps:
- name: Set Image Name
shell: sh
run: |
export REPO_FULL=${{ github.repository }}
export REPO_NAME=${REPO_FULL#*/}
if [ "${{ github.ref_name }}" != "master" ]; then
export IMAGE_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/$REPO_NAME-dev
else
export IMAGE_NAME=${{ secrets.DOCKER_HUB_USERNAME }}/$REPO_NAME
fi
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV