Remove caching + add push for optimized images back onto main

This commit is contained in:
2026-08-09 22:47:04 -04:00
parent 9f9f4f3e55
commit e3f5c53ebc

View File

@@ -15,8 +15,9 @@ on:
workflow_dispatch: workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
# Set write permission to allow the workflow to push image optimizations
permissions: permissions:
contents: read contents: write
pages: write pages: write
id-token: write id-token: write
@@ -43,22 +44,19 @@ jobs:
- name: Setup Pages - name: Setup Pages
id: pages id: pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
- name: Restore optimized images from cache
uses: actions/cache/restore@v4
with:
path: ./_site/assets/img
key: images
- name: Build with Jekyll - name: Build with Jekyll
# Outputs to the './_site' directory by default # Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env: env:
JEKYLL_ENV: production JEKYLL_ENV: production
- name: Save images to cache - name: Push image optimizations onto main
if: steps.cache-unity.outputs.cache-hit != 'true' run: |
uses: actions/cache/save@v4 git config user.name "github-actions[bot]"
with: git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
path: ./_site/assets/img git switch main
key: images git add assets/img
git commit -m "chore: optimize images"
git push
- name: Upload artifact - name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default # Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3