fix(ci): compatibility with gitea
Some checks failed
CI Pipeline / Build and Push Docker Image (push) Failing after 17s

This commit is contained in:
Aleksandr Tcitlionok
2024-12-11 09:39:05 +00:00
parent acef6cb9a1
commit d28a87a02c

View File

@@ -9,7 +9,9 @@ on:
- main
env:
IMAGE_NAME: ghcr.io/terghalin/metalcheck-backend
GH_REGISTRY: ghcr.io
LOCAL_REGISTRY: ${{ secrets.LOCAL_REGISTRY }}
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
@@ -23,10 +25,19 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
- name: Determine Registry
id: registry
run: |
if [[ "${{ github.repository }}" == *github.com* ]]; then
echo "REGISTRY=${{ env.GH_REGISTRY }}" >> $GITHUB_ENV
else
echo "REGISTRY=${{ env.LOCAL_REGISTRY }}" >> $GITHUB_ENV
shell: bash
- name: Log in to Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
@@ -43,5 +54,5 @@ jobs:
with:
push: true
tags: |
${{ env.IMAGE_NAME }}:latest
${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}