Skip to content

Commit

Permalink
tlmgrをキャッシュするようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
Till0196 committed Nov 13, 2024
1 parent 2d0364c commit c059b4a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c059b4a

Please sign in to comment.