我想从私有码头注册中心在容器中运行我的工作流:
jobs:
build:
runs-on: ubuntu-latest
container:
image: my-registry.net/my-image:latest
steps:
- ...现在我的码头注册中心是内部的,可以通过vpn访问。所以我想我可以通过运行另一项工作来解决这个问题:
jobs:
tailscale:
runs-on: ubuntu-latest
steps:
- name: Connect to Tailscale
uses: tailscale/github-action@v1
with:
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
version: 1.18.2
- name: Login to Private Container Registry
uses: docker/login-action@v1
with:
registry: my-registry.net
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Pull Image
run: docker pull my-registry.net/my-image:latest
build:
needs: tailscale
runs-on: ubuntu-latest
container:
image: my-registry.net/my-image:latest
steps:
- ...但是,这个解决方案不起作用,因为GitHub不使用相同的运行程序执行不同的任务,正如here所讨论的那样。我怎样才能不使用自己的跑步者来完成这个任务呢?
发布于 2022-07-08 14:57:41
用您的“连接”代码创建一个操作并重用它,因为不使用您自己的运行程序,您需要每次在VPN中连接才能访问您的注册表。
https://stackoverflow.com/questions/72900118
复制相似问题