ci(amplify): run image optimizer in Amplify preBuild; upload artifacts from GH Action
This commit is contained in:
@@ -35,14 +35,8 @@ jobs:
|
|||||||
- name: Run image optimizer
|
- name: Run image optimizer
|
||||||
run: npm run optimize-images
|
run: npm run optimize-images
|
||||||
|
|
||||||
- name: Commit optimized images
|
- name: Upload optimized images
|
||||||
run: |
|
uses: actions/upload-artifact@v4
|
||||||
git config user.name "github-actions[bot]"
|
with:
|
||||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
name: optimized-images
|
||||||
git add public/images || true
|
path: public/images
|
||||||
if ! git diff --staged --quiet; then
|
|
||||||
git commit -m "chore(images): add optimized WebP images [skip ci]" || echo "no changes to commit"
|
|
||||||
git push
|
|
||||||
else
|
|
||||||
echo "No optimized images to commit"
|
|
||||||
fi
|
|
||||||
|
|||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
version: 1
|
||||||
|
applications:
|
||||||
|
- frontend:
|
||||||
|
phases:
|
||||||
|
preBuild:
|
||||||
|
commands:
|
||||||
|
- npm ci
|
||||||
|
- npm run optimize-images
|
||||||
|
build:
|
||||||
|
commands:
|
||||||
|
- npm run build
|
||||||
|
artifacts:
|
||||||
|
baseDirectory: build
|
||||||
|
files:
|
||||||
|
- "**/*"
|
||||||
|
cache:
|
||||||
|
paths:
|
||||||
|
- node_modules/**/
|
||||||
Reference in New Issue
Block a user