diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 6bd9c4a..4ab19dd 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -42,6 +42,22 @@ jobs: tags: ghcr.io/uetchy/uechi.io:latest cache-from: type=local,src=/tmp/.buildx-cache 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 run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index badeb25..8465399 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:15 as build +FROM node:15 as deps # 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 @@ -7,6 +7,9 @@ RUN dpkg -i pandoc-2.14.0.1-1-amd64.deb WORKDIR /app COPY package.json /app RUN yarn install + +FROM deps as build + COPY themes /app/themes COPY source /app/source COPY _config.yml /app/