mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-13 13:18:02 -05:00
feat: enhance Docker workflow to install and configure ImageMagick for screenshot processing
This commit is contained in:
parent
289dfc7f13
commit
f7325272a1
1 changed files with 17 additions and 10 deletions
27
.github/workflows/docker-build-and-push.yml
vendored
27
.github/workflows/docker-build-and-push.yml
vendored
|
@ -242,31 +242,38 @@ jobs:
|
||||||
path: web-app/test-results/
|
path: web-app/test-results/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Install ImageMagick
|
- name: Install and Configure ImageMagick
|
||||||
if: always()
|
if: always()
|
||||||
run: sudo apt-get update && sudo apt-get install -y imagemagick
|
run: |
|
||||||
|
sudo apt-get update && sudo apt-get install -y imagemagick
|
||||||
|
|
||||||
- name: Process Screenshots
|
- name: Process Screenshots
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
|
if [ ! -d "test-results" ]; then
|
||||||
|
echo "No test-results directory found"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p processed-screenshots
|
mkdir -p processed-screenshots
|
||||||
cd web-app/test-results
|
touch screenshot-report.md
|
||||||
|
|
||||||
|
cd test-results
|
||||||
for img in *.png; do
|
for img in *.png; do
|
||||||
if [ -f "$img" ]; then
|
if [ -f "$img" ]; then
|
||||||
convert "$img" -resize 800x processed-"$img"
|
|
||||||
echo "Processing screenshot for $img"
|
echo "Processing screenshot for $img"
|
||||||
BASE64_IMG=$(base64 -w 0 processed-"$img")
|
convert "$img" -resize 800x ../processed-screenshots/processed-"$img"
|
||||||
echo "### ${img%.*}" >> ../../screenshot-report.md
|
BASE64_IMG=$(base64 -w 0 ../processed-screenshots/processed-"$img")
|
||||||
echo "" >> ../../screenshot-report.md
|
echo "### ${img%.*}" >> ../screenshot-report.md
|
||||||
echo "" >> ../../screenshot-report.md
|
echo "" >> ../screenshot-report.md
|
||||||
|
echo "" >> ../screenshot-report.md
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
cd ../..
|
|
||||||
|
|
||||||
- name: Create PR Comment
|
- name: Create PR Comment
|
||||||
if: always() && github.event_name == 'pull_request'
|
if: always() && github.event_name == 'pull_request'
|
||||||
uses: peter-evans/create-or-update-comment@v3
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
with:
|
with:
|
||||||
issue-number: ${{ github.event.pull_request.number }}
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
body-path: screenshot-report.md
|
body-path: web-app/screenshot-report.md
|
||||||
edit-mode: replace
|
edit-mode: replace
|
||||||
|
|
Loading…
Reference in a new issue