diff --git a/.github/scripts/common.py b/.github/scripts/common.py index f0302e79a..62f58aa1c 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -11,7 +11,7 @@ def get_image_tag( """ Returns a string representing the normal image for a given package """ - return f"ghcr.io/{repo_name}/builder/{pkg_name}:{pkg_version}" + return f"ghcr.io/{repo_name.lower()}/builder/{pkg_name}:{pkg_version}" def get_cache_image_tag( @@ -26,7 +26,7 @@ def get_cache_image_tag( Registry type caching is utilized for the builder images, to allow fast rebuilds, generally almost instant for the same version """ - return f"ghcr.io/{repo_name}/builder/cache/{pkg_name}:{pkg_version}" + return f"ghcr.io/{repo_name.lower()}/builder/cache/{pkg_name}:{pkg_version}" def get_log_level(args) -> int: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10437aa2b..d908a456b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,6 +68,12 @@ jobs: - ci-backend - ci-frontend steps: + - + name: Set gchr repository name + id: set-ghrc-repository + run: | + ghcr_name=$(echo "${GITHUB_REPOSITORY}" | awk '{ print tolower($0) }') + echo ::set-output name=repository::${ghcr_name} - name: Checkout uses: actions/checkout@v3 @@ -115,6 +121,8 @@ jobs: outputs: + ghcr-repository: ${{ steps.set-ghrc-repository.outputs.repository }} + qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }} pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }} @@ -142,7 +150,7 @@ jobs: # a tag # Otherwise forks would require a Docker Hub account and secrets setup run: | - if [[ ${{ github.repository }} == "paperless-ngx/paperless-ngx" && ( ${{ github.ref_name }} == "main" || ${{ github.ref_name }} == "dev" || ${{ github.ref_name }} == "beta" || ${{ startsWith(github.ref, 'refs/tags/v') }} == "true" ) ]] ; then + if [[ ${{ needs.prepare-docker-build.outputs.ghcr-repository }} == "paperless-ngx/paperless-ngx" && ( ${{ github.ref_name }} == "main" || ${{ github.ref_name }} == "dev" || ${{ github.ref_name }} == "beta" || ${{ startsWith(github.ref, 'refs/tags/v') }} == "true" ) ]] ; then echo "Enabling DockerHub image push" echo ::set-output name=enable::"true" else @@ -155,7 +163,7 @@ jobs: uses: docker/metadata-action@v4 with: images: | - ghcr.io/${{ github.repository }} + ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }} name=paperlessngx/paperless-ngx,enable=${{ steps.docker-hub.outputs.enable }} tags: | # Tag branches with branch name @@ -206,11 +214,11 @@ jobs: # Get cache layers from this branch, then dev, then main # This allows new branches to get at least some cache benefits, generally from dev cache-from: | - type=registry,ref=ghcr.io/${{ github.repository }}/builder/cache/app:${{ github.ref_name }} - type=registry,ref=ghcr.io/${{ github.repository }}/builder/cache/app:dev - type=registry,ref=ghcr.io/${{ github.repository }}/builder/cache/app:main + type=registry,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}/builder/cache/app:${{ github.ref_name }} + type=registry,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}/builder/cache/app:dev + type=registry,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}/builder/cache/app:main cache-to: | - type=registry,mode=max,ref=ghcr.io/${{ github.repository }}/builder/cache/app:${{ github.ref_name }} + type=registry,mode=max,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}/builder/cache/app:${{ github.ref_name }} - name: Inspect image run: | diff --git a/.github/workflows/installer-library.yml b/.github/workflows/installer-library.yml index 879c31fc9..e236b94fb 100644 --- a/.github/workflows/installer-library.yml +++ b/.github/workflows/installer-library.yml @@ -36,6 +36,12 @@ jobs: name: Prepare Docker Image Version Data runs-on: ubuntu-20.04 steps: + - + name: Set gchr repository name + id: set-ghrc-repository + run: | + ghcr_name=$(echo "${GITHUB_REPOSITORY}" | awk '{ print tolower($0) }') + echo ::set-output name=repository::${ghcr_name} - name: Checkout uses: actions/checkout@v3 @@ -83,6 +89,8 @@ jobs: outputs: + ghcr-repository: ${{ steps.set-ghrc-repository.outputs.repository }} + qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }} pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }} @@ -134,6 +142,6 @@ jobs: dockerfile: ./docker-builders/Dockerfile.pikepdf build-json: ${{ needs.prepare-docker-build.outputs.pikepdf-json }} build-args: | - REPO=${{ github.repository }} + REPO=${{ needs.prepare-docker-build.outputs.ghcr-repository }} QPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.qpdf-json).version }} PIKEPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).version }}