feat(github actions): lowercase repo name for image tag

Ensures the repository name used in the Docker image tag is always lowercase for consistency.
This commit is contained in:
mmmohebi 2025-11-18 12:53:42 +03:30
parent 9888dab444
commit e3bc1cd0b0
1 changed files with 4 additions and 1 deletions

View File

@ -18,9 +18,12 @@ jobs:
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Lowercase Repository Name
run: echo "REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build and Push Docker Image - name: Build and Push Docker Image
env: env:
IMAGE_NAME: ${{ format('ghcr.io/{0}', toLower(github.repository)) }} IMAGE_NAME: ghcr.io/${{ env.REPO_LOWER }}
run: | run: |
docker build . --tag "${IMAGE_NAME}:${{ github.ref_name }}" docker build . --tag "${IMAGE_NAME}:${{ github.ref_name }}"
docker push "${IMAGE_NAME}:${{ github.ref_name }}" docker push "${IMAGE_NAME}:${{ github.ref_name }}"