From c059b4ac3cbaad89d5a4948ccb68d7045e70f4a4 Mon Sep 17 00:00:00 2001 From: Till0196 <16399842+Till0196@users.noreply.github.com> Date: Wed, 13 Nov 2024 10:41:35 +0900 Subject: [PATCH] =?UTF-8?q?tlmgr=E3=82=92=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 18 ++++++++++++++++++ Dockerfile | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04d8945..e8ce623 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,6 +60,24 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: tlmgr-pkgs Cache + uses: actions/cache@v4 + id: cache + with: + path: | + tlmgr-pkgs + key: cache-${{ hashFiles('Dockerfile') }}-${{ env.PLATFORM_PAIR }} + + - name: inject cache into docker + # v3.1.2のcommitを指定 + uses: reproducible-containers/buildkit-cache-dance@5b6db76d1da5c8b307d5d2e0706d266521b710de + with: + cache-map: | + { + "tlmgr-pkgs": "/tlmgr-pkgs" + } + skip-extraction: ${{ steps.cache.outputs.cache-hit }} + - name: Build and push by digest id: build uses: docker/build-push-action@v6 diff --git a/Dockerfile b/Dockerfile index 37c1a0e..2067d0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -65,14 +65,19 @@ RUN echo "Set PATH to $PATH" && \ # tlmgr section RUN tlmgr update --self +# cacheされたディレクトリはイメージに焼き付けられないため、最終生成物はキャッシュ外にコピーする # package install -RUN tlmgr install --no-persistent-downloads \ +RUN --mount=type=cache,target=/tlmgr-pkgs,sharing=locked \ + tlmgr restore --force --backupdir /tlmgr-pkgs --all || true && \ + tlmgr install --no-persistent-downloads \ latexmk collection-luatex collection-langjapanese \ collection-fontsrecommended type1cm mdframed needspace newtx \ fontaxes boondox everyhook svn-prov framed subfiles titlesec \ tocdata xpatch etoolbox l3packages \ biblatex pbibtex-base logreq biber import environ trimspaces tcolorbox \ ebgaramond algorithms algorithmicx xstring siunitx bussproofs enumitem && \ + tlmgr backup --clean --backupdir /tlmgr-pkgs --all && \ + tlmgr backup --backupdir /tlmgr-pkgs --all && \ tlmgr path add # EBGaramond