fix: write registry credentials directly to docker config.json for BuildKit
Some checks failed
Docker / build (push) Failing after 8m47s
Some checks failed
Docker / build (push) Failing after 8m47s
This commit is contained in:
@@ -43,11 +43,16 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
# docker/login-action uses OAuth token exchange which Gitea doesn't support.
|
||||
# Use docker login directly for basic auth.
|
||||
# Write credentials directly into config.json so BuildKit can read them
|
||||
# without triggering the OAuth token exchange that Gitea doesn't support.
|
||||
- name: Log in to registry
|
||||
if: github.event_name != 'pull_request'
|
||||
run: echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
||||
run: |
|
||||
mkdir -p ~/.docker
|
||||
printf '{"auths":{"%s":{"auth":"%s"}}}' \
|
||||
"${{ env.REGISTRY }}" \
|
||||
"$(printf '%s:%s' '${{ secrets.REGISTRY_USER }}' '${{ secrets.REGISTRY_PASSWORD }}' | base64 -w0)" \
|
||||
> ~/.docker/config.json
|
||||
|
||||
- name: Build and push — standard
|
||||
uses: docker/build-push-action@v6
|
||||
|
||||
Reference in New Issue
Block a user