-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Caching Jekyll-deploy-action Docker #11
Comments
Bumping this as the action currently takes 2.5 minutes to build which seems very long. |
Hi @datapolitical, This is a build based on docker, we can not cache this image for speeding up it, the large size of caching would exceed the limitation the GitHub allowed. I will try to investigate another way to speed up it. Thanks and regards. |
Maybe this will help: https://github.com/marketplace/actions/build-docker-images-using-cache |
Thanks for the help. : D |
Does this seem like a good lead? I could to set it up myself but I’d have to do it on a fork I think. |
I think you can fork this project and have a try, and welcome to give me a feedback. : D |
@datapolitical with the new name: Deploy to Github Pages
on:
push:
branches:
- main
paths:
- '**.md'
- '.github/workflows/jekyll.yml'
- '_config.yml'
- 'CNAME'
- 'Gemfile'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch
uses: actions/checkout@v2
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
path: gh-pages
ref: gh-pages
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Install Jekyll dependencies
run: bundle
- name: Build jekyll site
run: JEKYLL_ENV=production bundle exec jekyll build -c _config.yml -d ./build
- name: Generate build into gh-pages checkout
run: |
cd ./build
touch .nojekyll
echo "my.website" > CNAME
cp -r . ${{ github.workspace }}/gh-pages
- name: Commit jekyll build changes
run: |
cd ${{ github.workspace }}/gh-pages
git config --global user.email "myemail"
git config --global user.name "myuser"
git add .
git commit -m "ci: jekyll build from action ${GITHUB_SHA}"
- name: Push changes to gh-pages
uses: ad-m/github-push-action@v0.6.0
with:
directory: gh-pages
github_token: ${{ secrets.YOUR_GITHUB_PAT }}
branch: gh-pages
force: true However, this approach does not use the |
Hi @darioblanco,thanks for the suggestion and I think now this one has helped to @datapolitical . |
Yeah this is great I'm gonna have to experiment to figure out if it's compatible with what I've been doing and isn't going to cause any problems but it definitely looks interesting and thankfully I have a test setup I can use to verify that it works OK. |
@datapolitical, so sorry for no settling this issue, I will be happy to have a research on this no docker solution and try to refactor |
Oh awesome |
Firstly, thanks for your patience, now there is a good news to tell you, the running time of the action is mainly impacted by recompiling the gem native extensions every time. To solve this issue, we should cache the gems as well as their native extensions completely, the latest commit f9e971d has settled it. With this enhancement, the speed has been improved almost over 70%. Before (3m5s): https://github.com/jeffreytse/jekyll-deploy-action/actions/runs/1142065563 Thanks and Regards |
@datapolitical Now the new version v0.3.0 has been released, you can just use it by |
This update is causing my build to break with the following error: Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 286 299 300 |
With the new release, you should manually install additional dependencies according to your gems by the # Use GitHub Deploy Action to build and deploy to Github
jobs:
github-pages:
runs-on: ubuntu-latest
steps:
- uses: jeffreytse/jekyll-deploy-action@v0.3.0
with:
provider: 'github'
token: ${{ secrets.GH_TOKEN }} # It's your Personal Access Token(PAT)
repository: '' # Default is current repository
branch: 'gh-pages' # Default is gh-pages for github provider
jekyll_src: './' # Default is root directory
jekyll_cfg: '_config.yml' # Default is _config.yml
jekyll_baseurl: '' # Default is according to _config.yml
bundler_ver: '>=0' # Default is latest bundler version
cname: '' # Default is to not use a cname
actor: '' # Default is the GITHUB_ACTOR
pre_build_commands: 'pacman -S --noconfirm imagemagick' # Installing additional dependencies (Arch Linux) Thanks and Regards |
I'm using Ubuntu 20.04, is the command different? |
@datapolitical Since the action is based on Arch Linux, you should use pre-build commands based on Arch Linux, the package manager on Arch Linux is |
Something is wrong with the imagemagick install: Liquid Exception: |
@datapolitical Accordingly, additional dependency |
@datapolitical For better user experience, I will add a new feature to automatically checking gems used and installing relative system dependencies. For example, if you use |
Now that I've got my build time under 6 minutes the next big time sink is the 2+ minutes it takes to build the action. Caching seems to be possible using this: https://github.com/docker/build-push-action/issues but it's well outside my depth.
Figured I would pass it along in case you had thoughts.
The text was updated successfully, but these errors were encountered: