有没有办法缓存docker-compose,使其不会一遍又一遍地构建? 这是我的action工作流文件:
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 构建步骤。我尝试使用 if: steps.cache-docker.outputs.cache-hit != 'true' then only build
,但没有生效。