Mount Rainier I went back and added images to the last post.

I took some photos when I went out and had intended to add them but, assets can be tricky. Even my mid-range bargain phone takes photos that are far to large to upload directly. And since I took them with my phone, I definitely don’t want location data or other private details to be uploaded. Manually resizing images or striping metadata every time that I wanted to upload an image sounded like it would take too much discipline. I’m lazy and know that I can’t be trusted to remember to edit photos on future posts.

Knowing it’s better to have a simple working solution and something deployed than something complicated that you need to tweak for a week, I went with what I knew. I opted to go with imagemagick . The container for the github action from a previous post is able to run commands. Adding imagemagick it into the automated build seemed like a simple solution

I added some images from my home to my /assets folder, added another install step to the runner with the line sudo apt-get install imagemagick -y and another line to the build step mogrify -strip -resize 250000@ assets/images/*. And then, I had an assets pipeline that built and deployed lightweight images without unneeded metadata.

Here’s the altered action file.

jobs:
  build-deploy:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby 2.6
      uses: actions/setup-ruby@v1
      with:
        ruby-version: 2.6.x
    - name: Install dependencies
      run: |
        gem install bundler
        bundle config path vendor/bundle
        bundle install --jobs 4 --retry 3
        sudo apt-get install imagemagick -y
    - name: Build And Deploy
      env: 
        AWS_ACCESS_KEY_ID: ${{ secrets.YOUR_ACCESS_KEY_NAME }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.YOUR_SECRET_KEY_NAME }}
      run: |
        mogrify -strip -resize 250000@ assets/images/*
        bundle exec jekyll build --config _config.yml,_config-production.yml
        aws s3 sync _site/ s3://REDACTED

After adding images that were a little too small to fill the width of of a post, I had to write some css. After writing some ugly code, pushing it out, fixing it and then having wait an hour for my CDN to invalidate it. I’ve realized that I should probably take another shot at this next week and try a more sophisticated jekyll assets pipeline. I could also spend some time configuring webpack if I really wanted to. Neither sound fun.

I’m sure JavaScript will eventually make it on the site. I don’t want to make it hard to use npm modules so I want something that uses those without much configurations. I hesitate to do so because ene of the great things about jekyll is the uncomplicated build. The end product is static html files and css. For non-interactive text based content, what else do you really need?