Skip to content

Commit

Permalink
make repo lowwer case
Browse files Browse the repository at this point in the history
  • Loading branch information
VovaStelmashchuk committed Dec 28, 2024
1 parent 8e05188 commit 142ca5b
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ on:
branches:
- "new-version"

env:
REGISTRY: ghcr.io

jobs:
build-and-push-image:
runs-on: ubuntu-latest

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository | toLower() }}

permissions:
contents: read
packages: write
Expand All @@ -24,21 +22,25 @@ jobs:
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get repository name in lowercase
id: repo_name
run: echo "REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Get short SHA
id: sha
run: echo "::set-output name=sha::$(git rev-parse --short ${{ github.sha }})"
run: echo "sha=$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.REPO_NAME }}:latest
${{ env.REGISTRY }}/${{ env.REPO_NAME }}:${{ env.sha }}

0 comments on commit 142ca5b

Please sign in to comment.