[Fix] Correzione autenticazione Gitea Actions
- Sostituito gitea.actor con username hardcoded 'alessio' - Corretto tutti i riferimenti gitea.ref con github.ref - Gitea Actions usa le stesse variabili di GitHub per compatibilità - Aggiornata documentazione con spiegazione context variables - Fix: username nel docker login ora funzionante
This commit is contained in:
@@ -49,11 +49,11 @@ jobs:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
# Tag based on branch
|
||||
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' }}
|
||||
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/development' }}
|
||||
type=raw,value=development-latest,enable=${{ gitea.ref == 'refs/heads/development' }}
|
||||
type=raw,value=dev-latest,enable=${{ gitea.ref == 'refs/heads/dev' }}
|
||||
type=raw,value=staging-latest,enable=${{ gitea.ref == 'refs/heads/staging' }}
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/development' }}
|
||||
type=raw,value=development-latest,enable=${{ github.ref == 'refs/heads/development' }}
|
||||
type=raw,value=dev-latest,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||
# Tag with commit sha
|
||||
type=sha,prefix={{branch}}-,format=short
|
||||
# Tag with date
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ gitea.actor }}
|
||||
username: alessio
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
@@ -99,11 +99,11 @@ jobs:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: |
|
||||
# Tag based on branch with windows suffix
|
||||
type=raw,value=latest-windows,enable=${{ gitea.ref == 'refs/heads/main' }}
|
||||
type=raw,value=latest-windows,enable=${{ gitea.ref == 'refs/heads/development' }}
|
||||
type=raw,value=development-latest-windows,enable=${{ gitea.ref == 'refs/heads/development' }}
|
||||
type=raw,value=dev-latest-windows,enable=${{ gitea.ref == 'refs/heads/dev' }}
|
||||
type=raw,value=staging-latest-windows,enable=${{ gitea.ref == 'refs/heads/staging' }}
|
||||
type=raw,value=latest-windows,enable=${{ github.ref == 'refs/heads/main' }}
|
||||
type=raw,value=latest-windows,enable=${{ github.ref == 'refs/heads/development' }}
|
||||
type=raw,value=development-latest-windows,enable=${{ github.ref == 'refs/heads/development' }}
|
||||
type=raw,value=dev-latest-windows,enable=${{ github.ref == 'refs/heads/dev' }}
|
||||
type=raw,value=staging-latest-windows,enable=${{ github.ref == 'refs/heads/staging' }}
|
||||
# Tag with commit sha
|
||||
type=sha,prefix={{branch}}-windows-,format=short
|
||||
# Tag with date
|
||||
@@ -149,11 +149,11 @@ jobs:
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ gitea.actor }}
|
||||
username: alessio
|
||||
password: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
- name: Create and push manifest for main branch
|
||||
if: gitea.ref == 'refs/heads/main'
|
||||
if: github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||
docker buildx imagetools create -t ${IMAGE_LOWER}:latest \
|
||||
@@ -161,7 +161,7 @@ jobs:
|
||||
${IMAGE_LOWER}:latest-windows
|
||||
|
||||
- name: Create and push manifest for development branch
|
||||
if: gitea.ref == 'refs/heads/development'
|
||||
if: github.ref == 'refs/heads/development'
|
||||
run: |
|
||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||
docker buildx imagetools create -t ${IMAGE_LOWER}:latest \
|
||||
@@ -172,7 +172,7 @@ jobs:
|
||||
${IMAGE_LOWER}:development-latest-windows
|
||||
|
||||
- name: Create and push manifest for dev branch
|
||||
if: gitea.ref == 'refs/heads/dev'
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
run: |
|
||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||
docker buildx imagetools create -t ${IMAGE_LOWER}:dev-latest \
|
||||
@@ -180,7 +180,7 @@ jobs:
|
||||
${IMAGE_LOWER}:dev-latest-windows
|
||||
|
||||
- name: Create and push manifest for staging branch
|
||||
if: gitea.ref == 'refs/heads/staging'
|
||||
if: github.ref == 'refs/heads/staging'
|
||||
run: |
|
||||
IMAGE_LOWER=$(echo "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
|
||||
docker buildx imagetools create -t ${IMAGE_LOWER}:staging-latest \
|
||||
|
||||
Reference in New Issue
Block a user