我尝试构建一个 github 操作工作流,它依赖于数据库(可作为 docker 容器使用),而数据库又依赖于需要从 git 存储库克隆的数据。启动 docker 容器时数据需要可用。
目前我原始有以下设置(完整文件可在 GitHub 上找到)
jobs:
build-and-publish:
runs-on: ubuntu-latest # This job uses a GitHub-hosted runner.
services:
# befor this service is started the repository
# https://github.com/AKSW/aksw.org-model.git
# needs to be clones to a volume
fuseki:
image: stain/jena-fuseki
ports:
- 3030:3030
volumes:
- ${{ github.workspace }}/aksw-model:/staging
options: --entrypoint "exec /jena-fuseki/fuseki-server --file=/staging/aksw.org.nt /aksw"
steps:
# Checkout the data repository
- name: Check out Model Repository
uses: actions/checkout@v2
with:
# Repository name with owner. For example, actions/checkout
# Default: ${{ github.repository }}
repository: 'https://github.com/AKSW/aksw.org-model.git'
path: 'aksw-model'
- name: Further steps
…
如果在启动服务之前无法克隆存储库,是否可以克隆存储库,然后将容器作为步骤之一启动并保持在后台?