chore: cache multiple stages

This commit is contained in:
uetchy 2021-06-14 02:24:52 +09:00
parent 20cd435743
commit 8b685bca52
2 changed files with 20 additions and 1 deletions

View File

@ -43,6 +43,22 @@ jobs:
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Cache deps stage
uses: docker/build-push-action@v2
with:
target: deps
tags: deps_stage
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Cache build stage
uses: docker/build-push-action@v2
with:
target: build
tags: build_stage
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
- name: Image digest - name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }} run: echo ${{ steps.docker_build.outputs.digest }}

View File

@ -1,4 +1,4 @@
FROM node:15 as build FROM node:15 as deps
# https://github.com/jgm/pandoc/releases # https://github.com/jgm/pandoc/releases
RUN curl -LO https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb RUN curl -LO https://github.com/jgm/pandoc/releases/download/2.14.0.1/pandoc-2.14.0.1-1-amd64.deb
@ -7,6 +7,9 @@ RUN dpkg -i pandoc-2.14.0.1-1-amd64.deb
WORKDIR /app WORKDIR /app
COPY package.json /app COPY package.json /app
RUN yarn install RUN yarn install
FROM deps as build
COPY themes /app/themes COPY themes /app/themes
COPY source /app/source COPY source /app/source
COPY _config.yml /app/ COPY _config.yml /app/