Skip to content

Commit

Permalink
Make cache to be recreated if some dependency has been updated
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Feb 10, 2023
1 parent 3f96187 commit 39c46ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ inputs:
required: true
poetry-version:
required: true
outputs:
cache-key:
value: ${{ steps.restore-cache.outputs.cache-primary-key }}
runs:
using: "composite"
steps:
- name: Restore cached Poetry installation and its cache
id: restore-cache
uses: actions/cache/restore@v3
with:
path: |
~/.cache/pipx/venvs
~/.local/bin
~/.cache/pypoetry/
key: poetry-installation-and-cache-${{ inputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('pyproject.toml') }}

key: ignore-me
restore-keys: |
poetry-installation-and-cache-${{ inputs.python-version }}-${{ inputs.poetry-version }}-
- name: Install Poetry
shell: bash
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ jobs:
~/.cache/pipx/venvs
~/.local/bin
~/.cache/pypoetry/
key: ${{ steps.prepare.outputs.cache-key }}
# A new key is created to update the cache if some dependency has been updated
key: poetry-installation-and-cache-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}-${{ hashFiles('**/poetry.lock') }}

publish-docker-latest:
name: publish latest Docker image
Expand Down

0 comments on commit 39c46ea

Please sign in to comment.