-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github Actions not caching _site #4
Comments
Thanks for your issue. I think you should config the workflow with the # Use GitHub Actions' cache to cache dependencies on servers
- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Use GitHub Actions' cache to cache site on servers
- uses: actions/cache@v2
with:
path: _site
key: ${{ runner.os }}-site-${{ hashFiles('**/index.html') }}
restore-keys: |
${{ runner.os }}-site- Thanks and regards |
Thanks! |
Turns out this is not working and my site build has ballooned to over 16 minutes because of the responsive image plugin I'm using. The action runs, the cache hit happens, but nothing is being stored in the cache.
But the response is: I assume there's something up with my path but it's exactly what was suggested above. |
I saw that you're not using this jekyll-deploy-action from here https://github.com/datapolitical/chrisfnicholson.github.io/blob/481414b45213dafaf635ba4b980ffa0050050966/.github/workflows/build-jekyll.yml#L54, so I think you cache a wrong site ouput folder. Thanks and regards |
It's the same action I just updated it to run in Ubuntu and added a few extra dependencies so my site would build properly. Shouldn't change the build folder. What's the directory structure because caching vendor/bundle works but I don't have a vendor folder in my local copy of the code. So part of me thinks I've specified that wrong. I really appreciate the help. |
Could you change your action to |
Hi @datapolitical , my deploy action has added |
This is the issue I'm talking about. It was a lot of work to make it compatible. |
Hi @datapolitical , don't worry, I will try to help you to settle down this issue, please be patient. : ) |
Thanks for the patience and currently this issue has been addressed and fixed.
# Use GitHub Actions' cache to cache site on servers
- uses: actions/cache@v2
with:
path: build
key: ${{ runner.os }}-build-${{ hashFiles('**/index.html') }}
restore-keys: |
${{ runner.os }}-build- And welcome to star this project for further updates in the future. : ) Thanks and regards |
When I use your action I get " /usr/bin/env: ‘ruby2.7’: No such file or directory" on line 89 https://github.com/datapolitical/chrisfnicholson.github.io/runs/2161384500?check_suite_focus=true |
I switched it back to my fork and now caching works great! Thanks so much for your help. Happy to debug the issue if you want but very glad this works, it took nearly 10 minutes off my build time. |
Hi @datapolitical, Currently I'm researching the issue Thanks and regards |
Hi @datapolitical, could you invite me to be a collaborator as follow instructive, so that I can re-run the action by myself conveniently, it will be fast to settle this issue for me. |
@datapolitical According to the latest result, it seems to a issue that used a wrong bundle cache built for Ubuntu but my action's Dockerfile is using Alpine Linux (super lightweight). |
If you want to keep debugging, I updated the development version of the action so that the the action will run any time there's an issue added to the repository. And yes, your action's Dockerfile uses Alpine Linux. If you wan't I'll try editing mine to remove the ubuntu stuff to see if yours can build the site properly, but at least when I tried a couple months ago, a couple of the plugins needed ubuntu. |
Hi @datapolitical, thanks for your help to dig this issue, a couple of the plugins's dependencies such as |
Hi @datapolitical I just commented the issue in your repository but never triggered the action |
Try opening a new issue, that worked for me. |
OK now it runs if you make a comment. |
I edited the action to remove the dependencies and to create a new cache and it looks like it works! Still waiting for it to finish generating all the files but figured I'd give you a heads up. |
Actually it looks like you fixed it because the old workflow you just ran also worked. |
Many thanks for your help and the cache compatibility issue has been addressed and fixed (#12), now you can just use the Thanks and regards |
@datapolitical Could you change back to the previous cache key? So that I can check if it does work. |
Trying it now live |
Hi @datapolitical, I have seen the action cleaned up the incompatible gem cache, so this issue should be settled down perfectly. |
Also, If you wouldn't mind creating a release, I prefer not to target my code at master because things can change. |
@datapolitical, I will publish a release in this weekend, any other new bugs I would also fix in this week. |
It's broken again |
Nevermind, I know what happened. it was a different plugin |
I'm running into an odd issue where every time my site deploys it has to re-generate all of the webp image files, because it can't find them in the destination directory (despite being in the same folder with the originals). The code runs fine locally, but that's because the _site folder is still there. But with this plugin that _site data disappears after it's pushed.
Edit: I should add that I had to fork the action and edit it to run with ubuntu-latest and bash in order to get the thing to run the webp plugin. If there's a way to update it to support the plugin using the current setup. https://github.com/datapolitical/jekyll-deploy-action
So I'm just sort of trying to figure out how to make the two work together correctly, and any thoughts you might have would be very welcome.
https://github.com/sverrirs/jekyll-webp/blob/master/lib/jekyll-webp/webpGenerator.rb
The text was updated successfully, but these errors were encountered: