Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

📦 ci: Remove Legacy GHCR Mirror (#16585)

Danny Avilaf10b1d91f1ee
diff --git a/.github/workflows/dev-branch-images.yml b/.github/workflows/dev-branch-images.yml
index 2c71cfd7d1..08d38824c7 100644
--- a/.github/workflows/dev-branch-images.yml
+++ b/.github/workflows/dev-branch-images.yml
@@ -46,4 +46,3 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- LEGACY_GHCR_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}
diff --git a/.github/workflows/dev-images.yml b/.github/workflows/dev-images.yml
index a8b819ae72..eda56c689b 100644
--- a/.github/workflows/dev-images.yml
+++ b/.github/workflows/dev-images.yml
@@ -42,4 +42,3 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- LEGACY_GHCR_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}
diff --git a/.github/workflows/dev-staging-images.yml b/.github/workflows/dev-staging-images.yml
index 18e13cc920..49c30a3b6f 100644
--- a/.github/workflows/dev-staging-images.yml
+++ b/.github/workflows/dev-staging-images.yml
@@ -21,4 +21,3 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- LEGACY_GHCR_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
index 147cf7976b..69ceddb644 100644
--- a/.github/workflows/docker-publish.yml
+++ b/.github/workflows/docker-publish.yml
@@ -45,11 +45,6 @@ on:
required: true
DOCKERHUB_TOKEN:
required: true
- LEGACY_GHCR_TOKEN:
- description: >-
- Token that can write to the LEGACY_GHCR_OWNER namespace. Without it the
- mirror step is skipped.
- required: false
permissions:
contents: read
@@ -247,61 +242,3 @@ jobs:
set -euo pipefail
first_tag=$(grep -m1 -v '^[[:space:]]*$' <<< "$TAG_SUFFIXES")
docker buildx imagetools inspect "${GHCR_IMAGE}:${first_tag}"
-
- # After the move to another owner, deployments still pull the old GHCR namespace.
- # Copying each published tag there keeps them updating until the deprecation window
- # closes. Copies are cross-repo blob mounts within GHCR, so no image data is rebuilt
- # or re-uploaded.
- #
- # It runs in its own job so the credential that can write to the legacy namespace
- # lives in an environment, out of reach of workflows on other branches, and so a
- # mirror failure cannot fail a publish.
- #
- # Set the LEGACY_GHCR_OWNER variable and the LEGACY_GHCR_TOKEN secret (a token with
- # write:packages for that owner) to turn this on. It stays off when either is unset,
- # and while the owner still matches the one publishing the images.
- mirror:
- name: Mirror ${{ matrix.image.image_name }} to the legacy namespace
- if: ${{ vars.LEGACY_GHCR_OWNER != '' }}
- needs: merge
- runs-on: ubuntu-latest
- timeout-minutes: 15
- continue-on-error: true
- environment: legacy-mirror
- strategy:
- fail-fast: false
- matrix:
- image: ${{ fromJSON(inputs.images) }}
-
- steps:
- - name: Copy the published tags
- env:
- LEGACY_OWNER: ${{ vars.LEGACY_GHCR_OWNER }}
- LEGACY_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}
- IMAGE_NAME: ${{ matrix.image.image_name }}
- TAG_SUFFIXES: ${{ inputs.tag_suffixes }}
- run: |
- set -euo pipefail
-
- legacy_owner="${LEGACY_OWNER,,}"
- if [ "$legacy_owner" = "${GITHUB_REPOSITORY_OWNER,,}" ]; then
- echo "Legacy owner matches the current owner; nothing to mirror."
- exit 0
- fi
- if [ -z "$LEGACY_TOKEN" ]; then
- echo "::warning::LEGACY_GHCR_OWNER is set but LEGACY_GHCR_TOKEN is not; skipping the mirror."
- exit 0
- fi
-
- # Registry names must be lowercase, and the repository owner is not guaranteed to be.
- source_image="ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/${IMAGE_NAME}"
- legacy_image="ghcr.io/${legacy_owner}/${IMAGE_NAME}"
-
- # This login reads both namespaces: it replaces the default ghcr.io credential.
- echo "$LEGACY_TOKEN" | docker login ghcr.io -u "$legacy_owner" --password-stdin
-
- while IFS= read -r suffix; do
- [ -n "$suffix" ] || continue
- echo "Mirroring ${source_image}:${suffix} -> ${legacy_image}:${suffix}"
- docker buildx imagetools create -t "${legacy_image}:${suffix}" "${source_image}:${suffix}"
- done <<< "$TAG_SUFFIXES"
diff --git a/.github/workflows/main-image-workflow.yml b/.github/workflows/main-image-workflow.yml
index 69017308c3..a1482d9c94 100644
--- a/.github/workflows/main-image-workflow.yml
+++ b/.github/workflows/main-image-workflow.yml
@@ -57,4 +57,3 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- LEGACY_GHCR_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}
diff --git a/.github/workflows/tag-images.yml b/.github/workflows/tag-images.yml
index af7c14d939..450e3ef939 100644
--- a/.github/workflows/tag-images.yml
+++ b/.github/workflows/tag-images.yml
@@ -73,4 +73,3 @@ jobs:
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
- LEGACY_GHCR_TOKEN: ${{ secrets.LEGACY_GHCR_TOKEN }}