feat: set-image-name
This commit is contained in:
parent
4a01570b5f
commit
ec4a5384ab
3 changed files with 19 additions and 59 deletions
19
.forgejo/actions/set-image-name/action.yml
Normal file
19
.forgejo/actions/set-image-name/action.yml
Normal file
|
@ -0,0 +1,19 @@
|
|||
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=${{ env.DOCKER_HUB_USERNAME }}/$REPO_NAME-dev
|
||||
else
|
||||
export IMAGE_NAME=${{ env.DOCKER_HUB_USERNAME }}/$REPO_NAME
|
||||
fi
|
||||
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV
|
||||
env:
|
||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
Loading…
Add table
Add a link
Reference in a new issue