Skip to content

Instantly share code, notes, and snippets.

@poudelmadhav
Last active May 17, 2022 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poudelmadhav/e3b5a62b05f009dcf5605f24345387b5 to your computer and use it in GitHub Desktop.
Save poudelmadhav/e3b5a62b05f009dcf5605f24345387b5 to your computer and use it in GitHub Desktop.
Cache webpacker and assets precombile
# Source: https://github.community/t/cache-rails-assets-generated-by-webpacker/189057/4
- name: Get Webpacker cache key
id: get-webpacker-cache-key
run: |
echo "::set-output name=key::$(bin/rails r 'print Webpacker::Instance.new.compiler.send(:watched_files_digest)')"
shell: bash
- name: Cache precompiled assets
uses: actions/cache@v3
with:
path: |
public/packs-test
tmp/cache/webpacker
key: ${{ runner.os }}-assets-${{ steps.get-webpacker-cache-key.outputs.key }}
restore-keys: |
${{ runner.os }}-assets-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment