From 431235ba4a831ddaa682bcbb7c66ed9d71c3ae42 Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Wed, 9 Aug 2023 23:32:02 +0200 Subject: [PATCH 1/7] Trying new GHA for taking a screenshot: flameddd/screenshots-ci-action --- .github/workflows/generate-mindmap.yml | 41 +++++++++++++++++--------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index 9da560145..148db1cd4 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -29,18 +29,31 @@ jobs: run: npm install - name: Run Markmap run: npx markmap --no-toolbar innersource-program-mind-map.md -o innersource-program-mind-map.html - - name: Screenshot Markmap Website - id: screenshot-generator - uses: swinton/screenshot-website@v1.x + # - name: Screenshot Markmap Website + # id: screenshot-generator + # uses: swinton/screenshot-website@v1.x + # with: + # source: pattern-categorization/innersource-program-mind-map.html + # destination: innersource-program-mind-map.png + # full-page: false + # - name: Copy Screenshot + # run: cp ${{ steps.screenshot-generator.outputs.path }} . + # - name: Reduce Screenshot Size (PNG) + # run: npx optipng innersource-program-mind-map.png + # - name: Commit Changes + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: Re-creating markmap and screenshot + - name: install puppeteer-headful + uses: mujo-code/puppeteer-headful@master # Required for headful puppeteer + env: + CI: 'true' + - name: screenshots-ci-action + uses: flameddd/screenshots-ci-action@master with: - source: pattern-categorization/innersource-program-mind-map.html - destination: innersource-program-mind-map.png - full-page: false - - name: Copy Screenshot - run: cp ${{ steps.screenshot-generator.outputs.path }} . - - name: Reduce Screenshot Size (PNG) - run: npx optipng innersource-program-mind-map.png - - name: Commit Changes - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Re-creating markmap and screenshot + url: pattern-categorization/innersource-program-mind-map.html + # devices: iPhone 6,iPhone 6 landscape,Nexus 7,Pad Pro,Galaxy S III landscape,iPad Pro landscape + # - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 + # with: + # path: screenshots + # name: Download-screenshots From 61863d0a710284a17b57bcc7d1062c5435c1df02 Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Wed, 9 Aug 2023 23:43:35 +0200 Subject: [PATCH 2/7] Can a use an absolute path as URL? --- .github/workflows/generate-mindmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index 148db1cd4..21ab60355 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -51,7 +51,7 @@ jobs: - name: screenshots-ci-action uses: flameddd/screenshots-ci-action@master with: - url: pattern-categorization/innersource-program-mind-map.html + url: file://${{ GITHUB_WORKSPACE }}/pattern-categorization/innersource-program-mind-map.html # devices: iPhone 6,iPhone 6 landscape,Nexus 7,Pad Pro,Galaxy S III landscape,iPad Pro landscape # - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 # with: From 8d44283aea26b6fca66aba92d05f8353b6fb0b9f Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Wed, 9 Aug 2023 23:46:19 +0200 Subject: [PATCH 3/7] Try with context property --- .github/workflows/generate-mindmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index 21ab60355..496d7398f 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -51,7 +51,7 @@ jobs: - name: screenshots-ci-action uses: flameddd/screenshots-ci-action@master with: - url: file://${{ GITHUB_WORKSPACE }}/pattern-categorization/innersource-program-mind-map.html + url: file://${{ github.workspace }}/pattern-categorization/innersource-program-mind-map.html # devices: iPhone 6,iPhone 6 landscape,Nexus 7,Pad Pro,Galaxy S III landscape,iPad Pro landscape # - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 # with: From 6bc2bda86c24dd2d65a38663aff66e7511a0606c Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Wed, 9 Aug 2023 23:55:10 +0200 Subject: [PATCH 4/7] Where to find the screenshot that should have been generated? --- .github/workflows/generate-mindmap.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index 496d7398f..83eaa78f0 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -52,8 +52,9 @@ jobs: uses: flameddd/screenshots-ci-action@master with: url: file://${{ github.workspace }}/pattern-categorization/innersource-program-mind-map.html + type: 'png' # devices: iPhone 6,iPhone 6 landscape,Nexus 7,Pad Pro,Galaxy S III landscape,iPad Pro landscape - # - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 - # with: - # path: screenshots - # name: Download-screenshots + - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 + with: + path: screenshots + name: Download-screenshots From 2455118b7fd0ebd22e9db28872013e4154a5840f Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Sat, 12 Aug 2023 08:21:35 +0200 Subject: [PATCH 5/7] Try running screenshot-website GHA from main branch (unreleased version) --- .github/workflows/generate-mindmap.yml | 28 +++++++------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index 83eaa78f0..b02b4a6b2 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -29,13 +29,13 @@ jobs: run: npm install - name: Run Markmap run: npx markmap --no-toolbar innersource-program-mind-map.md -o innersource-program-mind-map.html - # - name: Screenshot Markmap Website - # id: screenshot-generator - # uses: swinton/screenshot-website@v1.x - # with: - # source: pattern-categorization/innersource-program-mind-map.html - # destination: innersource-program-mind-map.png - # full-page: false + - name: Screenshot Markmap Website + id: screenshot-generator + uses: swinton/screenshot-website@main + with: + source: pattern-categorization/innersource-program-mind-map.html + destination: innersource-program-mind-map.png + full-page: false # - name: Copy Screenshot # run: cp ${{ steps.screenshot-generator.outputs.path }} . # - name: Reduce Screenshot Size (PNG) @@ -44,17 +44,3 @@ jobs: # uses: stefanzweifel/git-auto-commit-action@v4 # with: # commit_message: Re-creating markmap and screenshot - - name: install puppeteer-headful - uses: mujo-code/puppeteer-headful@master # Required for headful puppeteer - env: - CI: 'true' - - name: screenshots-ci-action - uses: flameddd/screenshots-ci-action@master - with: - url: file://${{ github.workspace }}/pattern-categorization/innersource-program-mind-map.html - type: 'png' - # devices: iPhone 6,iPhone 6 landscape,Nexus 7,Pad Pro,Galaxy S III landscape,iPad Pro landscape - - uses: actions/upload-artifact@v2 # Upload screenshots to Actions Artifacts via actions/upload-artifact@v2 - with: - path: screenshots - name: Download-screenshots From 50e2a111fd0306844e867acfd7428fca1c512994 Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Sat, 12 Aug 2023 08:26:23 +0200 Subject: [PATCH 6/7] Trying to use outputs variable - was that effected by the change to set-outputs in actions/core? --- .github/workflows/generate-mindmap.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index b02b4a6b2..e9c8369ea 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -36,11 +36,11 @@ jobs: source: pattern-categorization/innersource-program-mind-map.html destination: innersource-program-mind-map.png full-page: false - # - name: Copy Screenshot - # run: cp ${{ steps.screenshot-generator.outputs.path }} . - # - name: Reduce Screenshot Size (PNG) - # run: npx optipng innersource-program-mind-map.png - # - name: Commit Changes - # uses: stefanzweifel/git-auto-commit-action@v4 - # with: - # commit_message: Re-creating markmap and screenshot + - name: Copy Screenshot + run: cp ${{ steps.screenshot-generator.outputs.path }} . + - name: Reduce Screenshot Size (PNG) + run: npx optipng innersource-program-mind-map.png + - name: Commit Changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Re-creating markmap and screenshot From bd96a454530b74009e224152e335fe8059e1c155 Mon Sep 17 00:00:00 2001 From: Sebastian Spier Date: Sat, 12 Aug 2023 08:31:33 +0200 Subject: [PATCH 7/7] markmap: add --no-open parameter. possibly faster build time? --- .github/workflows/generate-mindmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/generate-mindmap.yml b/.github/workflows/generate-mindmap.yml index e9c8369ea..69d4c8d61 100644 --- a/.github/workflows/generate-mindmap.yml +++ b/.github/workflows/generate-mindmap.yml @@ -28,7 +28,7 @@ jobs: - name: Install Node.js dependencies run: npm install - name: Run Markmap - run: npx markmap --no-toolbar innersource-program-mind-map.md -o innersource-program-mind-map.html + run: npx markmap --no-open --no-toolbar innersource-program-mind-map.md -o innersource-program-mind-map.html - name: Screenshot Markmap Website id: screenshot-generator uses: swinton/screenshot-website@main