Fix: use lowercase repository name for Docker tags and cache refs; compute image via meta step
This commit is contained in:
@@ -43,10 +43,16 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Set image name (lowercase)
|
||||
id: meta
|
||||
run: |
|
||||
IMAGE="${{ secrets.DOCKER_REGISTRY }}/${{ toLower(gitea.repository) }}"
|
||||
echo "image=${IMAGE}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Log in to Gitea container registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ secrets.DOCKER_REGISTRY }}
|
||||
registry: ${{ steps.meta.outputs.image }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
@@ -57,7 +63,7 @@ jobs:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
tags: |
|
||||
${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:${{ gitea.sha }}
|
||||
${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest
|
||||
cache-from: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest
|
||||
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest,mode=max
|
||||
${{ steps.meta.outputs.image }}:${{ gitea.sha }}
|
||||
${{ steps.meta.outputs.image }}:latest
|
||||
cache-from: type=registry,ref=${{ steps.meta.outputs.image }}:latest
|
||||
cache-to: type=registry,ref=${{ steps.meta.outputs.image }}:latest,mode=max
|
||||
|
||||
Reference in New Issue
Block a user