Skip to content

Commit

Permalink
Update to new apt cache action
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Feb 10, 2023
1 parent cb039d8 commit f20a2f0
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions .github/actions/web/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,6 @@ runs:
with:
path: web/.venv
key: web/.venv-${{ hashFiles('web/requirements.txt') }}
- name: Setup Apt for caching
shell: bash
run: |
sudo apt-get update -yq
sudo apt-get clean -yq
aptHash(){ echo "$1-$(apt-cache policy "$1" | grep -oP '(?<=Candidate:\s)(.+)')"; }
echo "aptVersion=$(aptHash texlive-base)-$(aptHash texlive-latex-extra)" >> $GITHUB_ENV
- name: Cache deb files
uses: actions/cache@v3
with:
path: .aptcache
key: deb-${{ env.aptVersion }}
restore-keys: |
deb-
- name: Restore deb files from cache
shell: bash
run: |
if compgen -G ".aptcache/*.deb" > /dev/null; then
sudo cp .aptcache/*.deb /var/cache/apt/archives/
fi
- name: Install base Apt packages
id: cache-apt
uses: awalsh128/cache-apt-pkgs-action@latest
Expand All @@ -41,11 +21,9 @@ runs:
packages: doxygen graphviz libgraphviz-dev librsvg2-bin pdf2svg
version: 1.0
- name: Install texlive Apt dependencies
shell: bash
run: |
sudo apt-get install -yq texlive-base texlive-latex-extra
mkdir -p .aptcache
sudo cp /var/cache/apt/archives/*.deb .aptcache/
uses: Eeems-Org/apt-cache-action
with:
packages: texlive-base texlive-latex-extra
- name: Build website
shell: bash
run: cd web && make prod
Expand Down

0 comments on commit f20a2f0

Please sign in to comment.