Optimizing Elixir CI in GitHub Actions

almirsarajcic

almirsarajcic

Created 6 months ago

The Official GitHub Actions documentation suggests using the .lock file hash as the cache key, which makes the cache stale and the whole workflow slows down after some time.

There’s a better way:

- name: Save dependencies cache
  uses: actions/cache/save@v4
  with:
    key: mix-${{ github.sha }}
    path: |
      _build
      deps

Read more: https://optimum.ba/blog/optimum-elixir-ci-with-github-actions