【发布时间】:2020-02-16 22:46:11
【问题描述】:
我正在尝试编写一个自定义 github-action,它在 docker 容器中运行一些命令,但允许用户选择它们在哪个 docker 容器中运行(即,我可以在不同版本的运行时运行相同的构建指令环境)
我的直觉是将我的.github/actions/main/action.yml 文件作为
name: 'Docker container command execution'
inputs:
dockerfile:
default: Dockerfile_r_latest
runs:
using: 'docker'
image: '${{ inputs.dockerfile }}'
args:
- /scripts/commands.sh
但是,这会出现以下错误:
##[error](Line: 7, Col: 10): Unrecognized named-value: 'inputs'. Located at position 1 within expression: inputs.dockerfile
任何帮助将不胜感激!
文件参考
我的.github/workflow/build_and_test.yml 文件是:
name: Test Package
on:
[push, pull_request]
jobs:
R_latest:
name: Test on latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
name: Checkout project
- uses: ./.github/actions/main
name: Build and test
with:
dockerfile: Dockerfile_r_latest
而我的 Dockerfile .github/actions/main/Dockerfile_r_latest 是:
FROM rocker/verse:latest
ADD scripts /scripts
ENTRYPOINT [ "bash", "-c" ]
【问题讨论】:
标签: docker github-actions