Skip to content

breaking: new version #84

breaking: new version

breaking: new version #84

Workflow file for this run

---
name: screenshots
on: # yamllint disable-line rule:truthy
pull_request:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
permissions:
id-token: write
contents: write
pull-requests: write
actions: write
jobs:
screenshots:
if: ${{ ! contains('
release-please--branches
dependabot/
', github.head_ref)
}}
name: screenshots
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
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65
# - name: Run test
# uses: tj-actions/puppeteer@a2befb374cdb596ae129a21e0a52494eb028ee82
# id: puppeteer
# with:
# files: |
# puppeteer.js
- name: Install dependencies
run: |
npm i puppeteer
- name: github-profile-screenshot
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3
with:
run: |
node puppeteer.js "https://github.com/${{ github.REPOSITORY_OWNER }}" github-profile.png
- name: github-fork-screenshot
uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3
with:
run: |
node puppeteer.js "https://github.com/robinmordasiewicz/devops-toolkit" github-fork.png
- name: github-profile-border
uses: jruipinto/ImageMagick-action@f8361c3ab427051432299cef10d7c76424f7ff6d
with:
command: convert github-profile.png -shave 1x1 -bordercolor black -border 1 github-profile-border.png
- name: github-fork-border
uses: jruipinto/ImageMagick-action@f8361c3ab427051432299cef10d7c76424f7ff6d
with:
command: convert github-fork.png -shave 1x1 -bordercolor black -border 1 github-fork-border.png
- name: create-arrow
run: |
convert -size 486x96 \
xc:transparent \
-stroke red \
-strokewidth 0 \
-fill red \
-draw "ellipse 14,47 11,11 0,360" \
-draw "polygon 482,47 385,4 400,36 10,36 10,58 400,58 385,92" \
arrow.png
- name: rotate-arrows
run: |
convert -rotate 315 -background 'rgba(0,0,0,0)' arrow.png 315-arrow.png
convert -rotate 225 -background 'rgba(0,0,0,0)' arrow.png 225-arrow.png
rm arrow.png
- name: bevel
run: |
width=10
wfact=$((1000*$width))
leveling="-level 0,$wfact"
depth=80
icontr=`convert xc: -format "%[fx:(0.5*$depth-100)]" info:`
ocontr=`convert xc: -format "%[fx:(0.5*$depth-100)]" info:`
ideepening="-brightness-contrast 0,$icontr"
odeepening="-brightness-contrast 0,$ocontr"
for entry in 315-arrow.png 225-arrow.png
do
convert $entry -bordercolor none -border 10x10 -write mpr:img \
-alpha extract -write mpr:alpha \
+level 0,1000 -white-threshold 999 \
-morphology Distance:-1 Euclidean:$width,1000 $leveling \
-shade 120x45 -auto-level $ideepening \
\( +clone -fill "gray(50%)" -colorize 100% \) +swap \( mpr:alpha -threshold 0 \) \
-compose over -composite \
\( mpr:img -alpha off \) +swap -compose hardlight -composite \
mpr:alpha -alpha off -compose copy_opacity -composite \
-shave 10x10 \
arrow-bevel.png
mv arrow-bevel.png $entry
done
- name: create-border-shadow
run: |
for entry in 315-arrow.png 225-arrow.png
do
convert $entry \
-bordercolor none -border 20 \
\( -clone 0 -fill white -colorize 100 \) \
\( -clone 0 -alpha extract -write mpr:alpha -morphology edgeout disk:2 \) \
-alpha off -compose over -composite \
\( mpr:alpha -morphology dilate disk:2 \) \
-alpha off -compose copy_opacity -composite \
output.png
convert output.png \
-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 \
$entry
convert $entry \
\( +clone -background black -shadow 50x10+10+10 \) \
+swap \
-background none \
-layers merge \
+repage \
output.png
mv output.png $entry
done
- name: overlay-arrow
run: |
composite -geometry +915+140 315-arrow.png github-fork-border.png github-fork-arrow.png
mv github-fork-arrow.png github-fork.png
composite -geometry +525+160 225-arrow.png github-profile.png github-profile-arrow.png
mv github-profile-arrow.png github-profile.png
- name: make-drop-shadow
run: |
for entry in github-profile.png github-fork.png
do
convert $entry \( +clone -background black -shadow 100x40+0+16 \) \
+swap -background none -layers merge +repage output.png
convert output.png -bordercolor none -border 32 docs/img/$entry
rm $entry output.png
done
- name: cleanup
run: |
rm output.png 315-arrow.png 225-arrow.png arrow.png
- name: Push changes
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: updating screenshots"
git push