相关疑难解决方法(0)

如何在 github-action 中缓存 docker-compose 构建

有没有办法缓存 docker-compose 以便它不会一次又一次地构建?这是我的操作工作流文件:

name: Github Action
on:
  push:
    branches:
      - staging
jobs:
  test:
    runs-on: ubuntu-18.04

    steps:
      - uses: actions/checkout@v1

      - name: Bootstrap app on Ubuntu
        uses: actions/setup-node@v1
        with:
          node-version: '12'


      - name: Install global packages
        run: npm install -g yarn prisma


      - name: Install project deps
        if: steps.cache-yarn.outputs.cache-hit != 'true'
        run: yarn


      - name: Build docker-compose
        run: docker-compose -f docker-compose.test.prisma.yml up --build -d

Run Code Online (Sandbox Code Playgroud)

我想缓存 docker build 步骤。我试过使用if: steps.cache-docker.outputs.cache-hit != 'true' then only build 但没有用。

github docker-compose docker-build github-actions building-github-actions

8
推荐指数
3
解决办法
4520
查看次数