我正在使用帶有自動版本碰撞操作的 docker/build-push-action@v2 并且作業運行良好,直到我收到此錯誤的構建和推送步驟
/usr/bin/docker buildx build --build-arg NPM_TOKEN=*** --iidfile /tmp/docker-build-push-MO1ELt/iidfile --tag registry.digitalocean.com/xxx/xxx: --metadata-file /tmp/docker-build-push-MO1ELt/metadata-file --push ./xxx
error: invalid tag "registry.digitalocean.com/xxx/xxx:": invalid reference format
Error: buildx failed with: error: invalid tag "registry.digitalocean.com/xxx/xxx:": invalid reference format
我是否正確添加了標簽,還是版本凹凸包有問題?
我的 GitHub 操作檔案
name: deploy-auth
on:
push:
branches:
- main
paths:
- 'xxx/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v2
- name: Automated Version Bump
uses: 'phips28/gh-action-bump-version@master'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default: fix
tag-prefix: 'v'
- name: Output Step
env:
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
run: echo "new tag $NEW_TAG"
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DigitalOcean Container Registry with short-lived credentials
run: doctl registry login --expiry-seconds 600
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./xxx
push: true
tags: registry.digitalocean.com/xxx/xxx:${{ steps.version-bump.outputs.newTag }}
build-args: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }}
uj5u.com熱心網友回復:
GHA 中沒有任何version-bump步驟。這意味著${{ steps.version-bump.outputs.newTag }}是空的。您可以在步驟上設定一個 id 欄位來定義它:
- name: Automated Version Bump
uses: 'phips28/gh-action-bump-version@master'
id: version-bump
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
default: fix
tag-prefix: 'v'
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/463061.html
