我正在尝试按照GitHub文档的方式使用GitHub Actions将一个Docker镜像推送到公共Docker仓库,但我无法使其正常工作:
name: CI
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/docker/login@master
with: # Set the secret as an input
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
env: # Set the secret in the env
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Test
run: mvn clean verify -U
- name: build
run: ./mvnw compile jib:dockerBuild
- name: push
run: docker push odfsoft/guess-game:latest
我遇到了下面的错误:
/usr/bin/docker run --name bb8146f4246c56a44203bb2667ccfbdcab81_f18969 --label 04bb81 --workdir /github/workspace --rm -e DOCKER_USERNAME -e DOCKER_PASSWORD -e INPUT_DOCKER_USERNAME -e INPUT_DOCKER_PASSWORD -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/spring-boot-guess-game/spring-boot-guess-game":"/github/workspace" 04bb81:46f4246c56a44203bb2667ccfbdcab81
Error: Cannot perform an interactive login from a non TTY device
这是否与我的操作有关,还是Github Actions本身的限制?
DOCKER_PASSWPORD
中有拼写错误。 - Michael Bisbjerg