Christian Winther 1 년 전
부모
커밋
af1df5edfd
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 11 3
      .github/workflows/docker.yml

+ 11 - 3
.github/workflows/docker.yml

@@ -106,11 +106,19 @@ jobs:
       # at https://github.com/<user>/<project>/settings/variables/actions
       # at https://github.com/<user>/<project>/settings/variables/actions
       DOCKER_HUB_USERNAME: ${{ vars.DOCKER_HUB_USERNAME || 'pixelfed' }}
       DOCKER_HUB_USERNAME: ${{ vars.DOCKER_HUB_USERNAME || 'pixelfed' }}
 
 
+      # Set the repo variable [DOCKER_HUB_ORGANISATION] to override the default
+      # at https://github.com/<user>/<project>/settings/variables/actions
+      DOCKER_HUB_ORGANISATION: ${{ vars.DOCKER_HUB_ORGANISATION || 'pixelfed' }}
+
+      # Set the repo variable [DOCKER_HUB_REPO] to override the default
+      # at https://github.com/<user>/<project>/settings/variables/actions
+      DOCKER_HUB_REPO: ${{ vars.DOCKER_HUB_REPO || 'pixelfed' }}
+
       # For Docker Hub pushing to work, you need the secret [DOCKER_HUB_TOKEN]
       # For Docker Hub pushing to work, you need the secret [DOCKER_HUB_TOKEN]
       # set to your Personal Access Token at https://github.com/<user>/<project>/settings/secrets/actions
       # set to your Personal Access Token at https://github.com/<user>/<project>/settings/secrets/actions
       #
       #
       # ! NOTE: no [login] or [push] will happen to Docker Hub until this secret is set!
       # ! NOTE: no [login] or [push] will happen to Docker Hub until this secret is set!
-      HAS_DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN != '' }}
+      HAS_DOCKER_HUB_CONFIGURED: ${{ secrets.DOCKER_HUB_TOKEN != '' }}
 
 
     steps:
     steps:
       - name: Checkout Code
       - name: Checkout Code
@@ -135,7 +143,7 @@ jobs:
 
 
         # See: https://github.com/docker/login-action?tab=readme-ov-file#docker-hub
         # See: https://github.com/docker/login-action?tab=readme-ov-file#docker-hub
       - name: Login to Docker Hub registry (conditionally)
       - name: Login to Docker Hub registry (conditionally)
-        if: ${{ env.HAS_DOCKER_HUB_TOKEN == true }}
+        if: ${{ env.HAS_DOCKER_HUB_CONFIGURED == true }}
         uses: docker/login-action@v3
         uses: docker/login-action@v3
         with:
         with:
           username: ${{ env.DOCKER_HUB_USERNAME }}
           username: ${{ env.DOCKER_HUB_USERNAME }}
@@ -147,7 +155,7 @@ jobs:
         with:
         with:
           images: |
           images: |
             name=ghcr.io/${{ github.repository }},enable=true
             name=ghcr.io/${{ github.repository }},enable=true
-            name=${{ vars.GITHUB_REPOSITORY }},enable=${{ env.HAS_DOCKER_HUB_TOKEN }}
+            name=${{ env.DOCKER_HUB_ORGANISATION }}/${{ env.DOCKER_HUB_REPO }},enable=${{ env.HAS_DOCKER_HUB_CONFIGURED }}
           flavor: |
           flavor: |
             latest=auto
             latest=auto
             suffix=-${{ matrix.target_runtime }}-${{ matrix.php_version }}
             suffix=-${{ matrix.target_runtime }}-${{ matrix.php_version }}