fix(screenshots.json): adjust geometry value for better screenshot positioning The geometry value in the screenshots.json file was adjusted to "+150+450" from "+150+400". This change was made to improve the positioning of the screenshot, ensuring it captures the intended area of the screen more accurately. #149
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: screenshots | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
# push: | |
# paths: | |
# - "screenshots.json" | |
# branches-ignore: | |
# - main | |
# - dependabot/** | |
# - release-please/** | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: write | |
pull-requests: write | |
actions: write | |
jobs: | |
configure: | |
if: ${{ ! contains(' | |
release-please | |
dependabot | |
', github.head_ref) | |
}} | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- name: Set matrix data | |
id: set-matrix | |
run: echo "matrix=$(jq -c . < ./screenshots.json)" >> $GITHUB_OUTPUT | |
screenshots: | |
name: screenshots | |
if: ${{ ! contains(' | |
release-please | |
dependabot | |
', github.head_ref) | |
}} | |
needs: configure | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.configure.outputs.matrix) }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
ref: ${{ github.event.pull_request.head.ref }} | |
fetch-depth: 0 | |
- uses: browser-actions/setup-chrome@11cef13cde73820422f9263a707fb8029808e191 | |
if: ${{ matrix.url != '' }} | |
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 | |
if: ${{ matrix.url != '' }} | |
- name: Install dependencies | |
if: ${{ matrix.url != '' }} | |
run: | | |
npm i puppeteer | |
- name: take-screenshot | |
if: ${{ matrix.url != '' }} | |
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 | |
with: | |
run: | | |
node puppeteer.js ${{ matrix.url }} ./docs/img/screenshots/${{ matrix.filename }} | |
- name: overlay-arrow | |
run: | | |
composite -geometry ${{ matrix.geometry }} docs/img/overlays/pointer-${{ matrix.pointerangle }}.png docs/img/screenshots/${{ matrix.filename }} docs/img/${{ matrix.filename }} | |
- name: rounded-corners | |
run: | | |
size=$(identify -format "%[fx:w]x%[fx:h]" "docs/img/${{ matrix.filename }}") | |
width=$(echo $size | cut -d'x' -f1) | |
height=$(echo $size | cut -d'x' -f2) | |
convert -size $size xc:none -draw "roundrectangle 0,0,$width,$height,10,10" png:- | convert docs/img/${{ matrix.filename }} -matte - -compose DstIn -composite output.png | |
mv output.png docs/img/${{ matrix.filename }} | |
- name: add-border | |
run: | | |
convert docs/img/${{ matrix.filename }} \ | |
-bordercolor none -border 20 \ | |
\( -clone 0 -fill black -colorize 100 \) \ | |
\( -clone 0 -alpha extract -write mpr:alpha -morphology edgeout disk:1 \) \ | |
-alpha off -compose over -composite \ | |
\( mpr:alpha -morphology dilate disk:1 \) \ | |
-alpha off -compose copy_opacity -composite \ | |
output.png | |
mv output.png docs/img/${{ matrix.filename }} | |
- name: drop-shadow | |
run: | | |
convert docs/img/${{ matrix.filename }} \( +clone -background black -shadow 30x35+0+18 \) \ | |
+swap \ | |
-background none \ | |
-layers merge \ | |
+repage \ | |
output.png | |
convert output.png -bordercolor none -border 18 output2.png | |
mv output2.png docs/img/${{ matrix.filename }} | |
rm output.png | |
- name: Push changes | |
env: | |
BRANCH: ${{github.event.pull_request.head.ref}} | |
run: | | |
git config user.name "$(git log -n 1 --pretty=format:%an)" | |
git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
git add . | |
git commit -m "docs(${{ matrix.filename }}): processing screenshot" | |
git config pull.rebase false | |
git pull origin "$BRANCH" | |
git push --force-with-lease |