有没有办法缓存 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
我想缓存 docker build 步骤。我试过使用if: steps.cache-docker.outputs.cache-hit != 'true' then only build
但没有用。