ci: cache tectonic and tectonic deps
This commit is contained in:
parent
109731962d
commit
99a021d0b2
@ -12,14 +12,40 @@ variables:
|
||||
build:
|
||||
stage: build
|
||||
image: alpine:latest
|
||||
script:
|
||||
- apk update && apk upgrade && apk add curl
|
||||
- curl -L0 https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.14.1/tectonic-0.14.1-x86_64-unknown-linux-musl.tar.gz --output tectonic.tar.gz
|
||||
- tar -xf tectonic.tar.gz
|
||||
- ./tectonic -X compile --keep-logs ./resume.tex
|
||||
variables:
|
||||
TECTONIC_DEPS_CACHE_PATH: "${CI_PROJECT_DIR}/.cache/Tectonic"
|
||||
TECTONIC_BIN_CACHE_PATH: "${CI_PROJECT_DIR}/tectonic"
|
||||
cache:
|
||||
policy: pull-push
|
||||
when: on_success
|
||||
paths:
|
||||
- "${TECTONIC_DEPS_CACHE_PATH}"
|
||||
- "${TECTONIC_BIN_CACHE_PATH}"
|
||||
script: |
|
||||
mkdir -p "${CI_PROJECT_DIR}/.cache"
|
||||
mkdir -p "${HOME}/.cache"
|
||||
if [ -r "${TECTONIC_DEPS_CACHE_PATH}" ]; then
|
||||
mv "${TECTONIC_DEPS_CACHE_PATH}" "${HOME}/.cache"
|
||||
fi
|
||||
|
||||
if ! [ -x ./tectonic ]; then
|
||||
echo "Cache miss, tectonic binary not in cache! Redownloading!"
|
||||
apk update
|
||||
apk add curl
|
||||
curl -L0 https://github.com/tectonic-typesetting/tectonic/releases/download/tectonic%400.14.1/tectonic-0.14.1-x86_64-unknown-linux-musl.tar.gz --output tectonic.tar.gz
|
||||
tar -xf tectonic.tar.gz
|
||||
fi
|
||||
|
||||
echo "Compiling resume!"
|
||||
./tectonic -X compile --keep-logs ./resume.tex
|
||||
echo "Finished compiling resume, saving caches"
|
||||
|
||||
mv "${HOME}/.cache/Tectonic" "${CI_PROJECT_DIR}/.cache/Tectonic"
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "${RESUME_FILE}"
|
||||
|
||||
upload:
|
||||
stage: upload
|
||||
needs:
|
||||
|
Loading…
Reference in New Issue
Block a user