buildx failed with: ERROR: invalid tag

I am getting the following error:

/usr/bin/docker buildx version

[114](https://github.com/kirandash/greenhouse-react-ui/actions/runs/4764862393/jobs/8469948925#step:8:117) github.com/docker/buildx 0.10.4+azure-1 c513d34049e499c53468deac6c4267ee72948f02

[115](https://github.com/kirandash/greenhouse-react-ui/actions/runs/4764862393/jobs/8469948925#step:8:119)/usr/bin/docker buildx build --build-arg COMMIT_SHA=1445364a399b9ea0f8ffa2c2b36df77df544830e --cache-from type=local,src=/tmp/.buildx-cache --cache-to type=local,mode=max,dest=/tmp/.buildx-cache-new --iidfile /tmp/docker-build-push-0NGBvj/iidfile --provenance mode=max,builder-id=https://github.com/kirandash/greenhouse-react-ui/actions/runs/4764862393 --tag registry.fly.io/greenhouse-react-ui:build/deploy-to-fly-1445364a399b9ea0f8ffa2c2b36df77df544830e --metadata-file /tmp/docker-build-push-0NGBvj/metadata-file --push .

[116](https://github.com/kirandash/greenhouse-react-ui/actions/runs/4764862393/jobs/8469948925#step:8:120)ERROR: invalid tag "registry.fly.io/greenhouse-react-ui:build/deploy-to-fly-1445364a399b9ea0f8ffa2c2b36df77df544830e": invalid reference format

[117](https://github.com/kirandash/greenhouse-react-ui/actions/runs/4764862393/jobs/8469948925#step:8:121)Error: buildx failed with: ERROR: invalid tag "registry.fly.io/greenhouse-react-ui:build/deploy-to-fly-1445364a399b9ea0f8ffa2c2b36df77df544830e": invalid reference format

deploy.yml content:

name: πŸš€ Deploy
on:
  push:
    branches:
      - build/deploy-to-fly
  pull_request: {}

permissions:
  actions: write
  contents: read

jobs:
  lint:
    name: ⬣ ESLint
    runs-on: ubuntu-latest
    steps:
      - name: πŸ›‘ Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.11.0

      - name: ⬇️ Checkout repo
        uses: actions/checkout@v3

      - name: βŽ” Setup node
        uses: actions/setup-node@v3
        with:
          node-version: 18.16.0

      - name: πŸ“₯ Download deps
        run: npm install --legacy-peer-deps

      - name: πŸ”¬ Lint
        run: npm run lint

  rtltest:
    name: ⚑ RTL
    runs-on: ubuntu-latest
    steps:
      - name: πŸ›‘ Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.11.0

      - name: ⬇️ Checkout repo
        uses: actions/checkout@v3

      - name: βŽ” Setup node
        uses: actions/setup-node@v3
        with:
          node-version: 18.16.0

      - name: πŸ“₯ Download deps
        run: npm i --legacy-peer-deps

      - name: ⚑ Run RTL
        run: npm run test -- --coverage
      - run: npm run validate
      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v3
        with:
          file: ./coverage/coverage-final.json
          flags: unittest
          name: codecov-1

  build:
    name: 🐳 Build
    # only build/deploy main branch on pushes
    if:
      ${{ (github.ref == 'refs/heads/build/deploy-to-fly') &&
      github.event_name == 'push' }}
    runs-on: ubuntu-latest
    steps:
      - name: πŸ›‘ Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.11.0

      - name: ⬇️ Checkout repo
        uses: actions/checkout@v3

      - name: πŸ‘€ Read app name
        uses: SebRollen/toml-action@v1.0.2
        id: app_name
        with:
          file: 'fly.toml'
          field: 'app'

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

      # Setup cache
      - name: ⚑️ Cache Docker layers
        uses: actions/cache@v3
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-

      - name: πŸ”‘ Fly Registry Auth
        uses: docker/login-action@v2
        with:
          registry: registry.fly.io
          username: x
          password: ${{ secrets.FLY_API_TOKEN }}

      - name: 🐳 Docker build
        uses: docker/build-push-action@v4
        with:
          context: .
          push: true
          tags:
            registry.fly.io/${{ steps.app_name.outputs.value }}:${{
            github.ref_name }}-${{ github.sha }}
          build-args: |
            COMMIT_SHA=${{ github.sha }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new

      # This ugly bit is necessary if you don't want your cache to grow forever
      # till it hits GitHub's limit of 5GB.
      # Temp fix
      # https://github.com/docker/build-push-action/issues/252
      # https://github.com/moby/buildkit/issues/1896
      - name: 🚚 Move cache
        run: |
          rm -rf /tmp/.buildx-cache
          mv /tmp/.buildx-cache-new /tmp/.buildx-cache

  deploy:
    name: πŸš€ Deploy
    runs-on: ubuntu-latest
    needs: [lint, rtltest, build]
    # only build/deploy main branch on pushes
    if:
      ${{ (github.ref == 'refs/heads/build/deploy-to-fly') &&
      github.event_name == 'push' }}

    steps:
      - name: πŸ›‘ Cancel Previous Runs
        uses: styfle/cancel-workflow-action@0.11.0

      - name: ⬇️ Checkout repo
        uses: actions/checkout@v3

      - name: πŸ‘€ Read app name
        uses: SebRollen/toml-action@v1.0.2
        id: app_name
        with:
          file: 'fly.toml'
          field: 'app'

      - name: πŸš€ Deploy Staging
        if: ${{ github.ref == 'refs/heads/build/deploy-to-fly' }}
        uses: superfly/flyctl-actions@1.3
        with:
          args:
            'deploy --app ${{ steps.app_name.outputs.value }}-staging --image
            registry.fly.io/${{ steps.app_name.outputs.value }}:${{
            github.ref_name }}-${{ github.sha }}'
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

      - name: πŸš€ Deploy Production
        if: ${{ github.ref == 'refs/heads/build/deploy-to-fly' }}
        uses: superfly/flyctl-actions@1.3
        with:
          args:
            'deploy --image registry.fly.io/${{ steps.app_name.outputs.value
            }}:${{ github.ref_name }}-${{ github.sha }}'
        env:
          FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

Hi! It looks like you’re trying to push a tag called build/deploy-to-fly-1445364a399b9ea0f8ffa2c2b36df77df544830e. AFAIK tags are not allowed to contain forward slashes (see the docker tag docs), so I’m guessing this is why it isn’t working.