fix(ci): compatibility with gitea
Some checks failed
CI Pipeline / Build and Push Docker Image (push) Failing after 17s
Some checks failed
CI Pipeline / Build and Push Docker Image (push) Failing after 17s
This commit is contained in:
21
.github/workflows/ci.yaml
vendored
21
.github/workflows/ci.yaml
vendored
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user