Skip to content

Commit

Permalink
Use docker cache to speed up build times
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLoecker committed Sep 14, 2023
1 parent 583492c commit bb66349
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/container_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3


- name: Clean Jupyter Notebook Outputs
uses: actions/setup-python@v4
with:
Expand All @@ -65,6 +66,17 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Cache Docker Layers
id: cache
uses: actions/cache@v3
with:
path: |
/root/.cache/pip
/opt/conda/pkgs
/opt/conda/conda-meta
key: ${{ runner.os }}-${{ hashFiles('**/environment.yml') }}
restore-keys: ${{ runner.os }}-

- name: Build and push
uses: docker/build-push-action@v4
with:
Expand All @@ -74,3 +86,13 @@ jobs:
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

- name: Save Docker layer cache
id: save-cache
uses: actions/cache@v3
with:
path: |
/root/.cache/pip
/opt/conda/pkgs
/opt/conda/conda-meta
key: ${{ runner.os }}-${{ hashFiles('**/environment.yml') }}

0 comments on commit bb66349

Please sign in to comment.