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
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
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
|
- name: Log in to Gitea container registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ secrets.DOCKER_REGISTRY }}
|
registry: ${{ steps.meta.outputs.image }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
@@ -57,7 +63,7 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:${{ gitea.sha }}
|
${{ steps.meta.outputs.image }}:${{ gitea.sha }}
|
||||||
${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest
|
${{ steps.meta.outputs.image }}:latest
|
||||||
cache-from: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest
|
cache-from: type=registry,ref=${{ steps.meta.outputs.image }}:latest
|
||||||
cache-to: type=registry,ref=${{ secrets.DOCKER_REGISTRY }}/TheLab/shopping-list-api:latest,mode=max
|
cache-to: type=registry,ref=${{ steps.meta.outputs.image }}:latest,mode=max
|
||||||
|
|||||||
Reference in New Issue
Block a user