Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to github registry failed. insufficient_scope: authorization failed #723

Open
NcadoUatechPeople opened this issue Jan 17, 2023 · 0 comments

Comments

@NcadoUatechPeople
Copy link

NcadoUatechPeople commented Jan 17, 2023

I've trying to push my images to github registry
And faced error
> NX buildx failed with: ERROR: failed to solve: failed to push backend:main: server message: insufficient_scope: authorization failed
My github action


name: Node.js Package

on:
  push:
    branches: [ "main" ]
env:
  REGISTRY: ghcr.io
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:

      - name: Set up QEMU
        uses: docker/setup-qemu-action@v2
 
          
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v2

      - uses: actions/checkout@v3
        name: Checkout
        with:
          fetch-depth: 0

           

      - name: Log in to the Container registry
        uses: docker/login-action@v2
        with:
          registry: ${{ env.REGISTRY }}
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          
      - name: 'Install Dependencies'
        run: yarn install
           
      - name: Extract metadata (tags, labels) for Docker
        id: meta
        uses: docker/metadata-action@v4
        with:
          images: ${{ env.REGISTRY }}/vyzl
          tags: |
           type=semver,pattern={{version}}
           type=raw,value=latest
           type=sha,prefix=sha-
        
      - name: 'nx build'
        env:
           INPUT_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: INPUT_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} npx nx run-many --target=container,containerWorker --projects=vyzl-backend,vyzl-frontend

I successfully login into GitHub

image

My project target


"container": {
      "executor": "@nx-tools/nx-container:build",
      "options": {
        "file": "apps/vyzl-backend/backend.Dockerfile",
        "engine": "docker",
        "push": true,
        "context": ".",
        "metadata": {
          "images": [
            "UATechPeople/vyzl-backend"
          ],
          "tags": [
            "type=ref,event=branch",
            "type=ref,event=tag",
            "type=ref,event=pr",
            "type=semver,pattern={{version}}",
            "type=semver,pattern={{major}}.{{minor}}",
            "type=semver,pattern={{major}}",
            "type=sha,prefix=sha-",
            "ghcr.io/UATechPeople/vyzl-backend:latest",
            "ghcr.io/UATechPeople/vyzl-backend:v1"
          ]
        }
      }
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant