Add automatic repository owner to image naming

- Use github.repository_owner in workflow
- Image format: REGISTRY_URL/owner/APP_NAME:latest
- Works automatically with Gitea registry
- Template-friendly: forks use their own owner
- Update documentation with new format
This commit is contained in:
2025-10-12 22:19:20 -06:00
parent 7120d723ad
commit 0f7abc6d48
4 changed files with 13 additions and 7 deletions

View File

@@ -23,9 +23,9 @@ jobs:
- name: Build+push ${{ vars.APP_NAME }}
run: |
cd nuxt4
docker build -t $REG/$APP_NAME:${{ github.sha }} -t $REG/$APP_NAME:latest .
docker push $REG/$APP_NAME:${{ github.sha }}
docker push $REG/$APP_NAME:latest
docker build -t $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }} -t $REG/${{ github.repository_owner }}/$APP_NAME:latest .
docker push $REG/${{ github.repository_owner }}/$APP_NAME:${{ github.sha }}
docker push $REG/${{ github.repository_owner }}/$APP_NAME:latest
#───────────────── deploy ─────────────────
deploy:
@@ -33,6 +33,7 @@ jobs:
runs-on: docker
env:
REG: ${{ vars.REGISTRY_URL }}
REPO_OWNER: ${{ github.repository_owner }}
APP_NAME: ${{ vars.APP_NAME }}
# Variables de entorno para docker-compose
APP_DOMAIN: ${{ vars.APP_DOMAIN }}
@@ -46,7 +47,7 @@ jobs:
run: |
echo " Deploying ${{ vars.APP_NAME }}"
echo " Domain: ${{ vars.APP_DOMAIN }}"
echo " Registry: ${{ vars.REGISTRY_URL }}"
echo " Image: ${{ vars.REGISTRY_URL }}/${{ github.repository_owner }}/${{ vars.APP_NAME }}:latest"
echo " Network: principal"
- name: Pull fresh images used in compose