container repository name must be lowercase

This commit is contained in:
Aidan Stein 2022-07-03 14:43:18 -04:00
parent 1d38367e79
commit 145c41f462
3 changed files with 25 additions and 9 deletions

View File

@ -11,7 +11,7 @@ def get_image_tag(
""" """
Returns a string representing the normal image for a given package 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( 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 Registry type caching is utilized for the builder images, to allow fast
rebuilds, generally almost instant for the same version 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: def get_log_level(args) -> int:

View File

@ -68,6 +68,12 @@ jobs:
- ci-backend - ci-backend
- ci-frontend - ci-frontend
steps: 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 name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -115,6 +121,8 @@ jobs:
outputs: outputs:
ghcr-repository: ${{ steps.set-ghrc-repository.outputs.repository }}
qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }} qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }}
pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }} pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }}
@ -142,7 +150,7 @@ jobs:
# a tag # a tag
# Otherwise forks would require a Docker Hub account and secrets setup # Otherwise forks would require a Docker Hub account and secrets setup
run: | 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 "Enabling DockerHub image push"
echo ::set-output name=enable::"true" echo ::set-output name=enable::"true"
else else
@ -155,7 +163,7 @@ jobs:
uses: docker/metadata-action@v4 uses: docker/metadata-action@v4
with: with:
images: | images: |
ghcr.io/${{ github.repository }} ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}
name=paperlessngx/paperless-ngx,enable=${{ steps.docker-hub.outputs.enable }} name=paperlessngx/paperless-ngx,enable=${{ steps.docker-hub.outputs.enable }}
tags: | tags: |
# Tag branches with branch name # Tag branches with branch name
@ -206,11 +214,11 @@ jobs:
# Get cache layers from this branch, then dev, then main # Get cache layers from this branch, then dev, then main
# This allows new branches to get at least some cache benefits, generally from dev # This allows new branches to get at least some cache benefits, generally from dev
cache-from: | cache-from: |
type=registry,ref=ghcr.io/${{ github.repository }}/builder/cache/app:${{ github.ref_name }} type=registry,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-repository }}/builder/cache/app:${{ github.ref_name }}
type=registry,ref=ghcr.io/${{ github.repository }}/builder/cache/app:dev type=registry,ref=ghcr.io/${{ needs.prepare-docker-build.outputs.ghcr-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:main
cache-to: | 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 name: Inspect image
run: | run: |

View File

@ -36,6 +36,12 @@ jobs:
name: Prepare Docker Image Version Data name: Prepare Docker Image Version Data
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: 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 name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -83,6 +89,8 @@ jobs:
outputs: outputs:
ghcr-repository: ${{ steps.set-ghrc-repository.outputs.repository }}
qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }} qpdf-json: ${{ steps.qpdf-setup.outputs.qpdf-json }}
pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }} pikepdf-json: ${{ steps.pikepdf-setup.outputs.pikepdf-json }}
@ -134,6 +142,6 @@ jobs:
dockerfile: ./docker-builders/Dockerfile.pikepdf dockerfile: ./docker-builders/Dockerfile.pikepdf
build-json: ${{ needs.prepare-docker-build.outputs.pikepdf-json }} build-json: ${{ needs.prepare-docker-build.outputs.pikepdf-json }}
build-args: | build-args: |
REPO=${{ github.repository }} REPO=${{ needs.prepare-docker-build.outputs.ghcr-repository }}
QPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.qpdf-json).version }} QPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.qpdf-json).version }}
PIKEPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).version }} PIKEPDF_VERSION=${{ fromJSON(needs.prepare-docker-build.outputs.pikepdf-json).version }}