Last active
May 17, 2022 03:50
-
-
Save poudelmadhav/e3b5a62b05f009dcf5605f24345387b5 to your computer and use it in GitHub Desktop.
Cache webpacker and assets precombile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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