Merge pull request #23 from UniDash-Linux/feature/1-1-project-init #18
This file contains hidden or 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: Update Screenshots | |
| on: | |
| push: | |
| branches: [develop] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| mockups: ${{ steps.filter.outputs.mockups }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| mockups: | |
| - '_bmad-output/planning-artifacts/ux-design-directions.html' | |
| - 'scripts/generate-screenshots.mjs' | |
| generate: | |
| needs: changes | |
| if: needs.changes.outputs.mockups == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: develop | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install pngquant | |
| run: sudo apt-get install -y pngquant | |
| - name: Hash existing screenshots | |
| id: hash-before | |
| run: | | |
| if [ -d docs/src/assets/screenshots ]; then | |
| find docs/src/assets/screenshots -name '*.png' -exec sha256sum {} \; | sort > /tmp/before.txt | |
| else | |
| touch /tmp/before.txt | |
| fi | |
| - name: Generate screenshots | |
| run: node scripts/generate-screenshots.mjs | |
| - name: Check for changes | |
| id: check-changes | |
| run: | | |
| find docs/src/assets/screenshots -name '*.png' -exec sha256sum {} \; | sort > /tmp/after.txt | |
| if diff -q /tmp/before.txt /tmp/after.txt > /dev/null; then | |
| echo "No screenshot changes detected, skipping PR creation" | |
| exit 0 | |
| fi | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v8 | |
| if: steps.check-changes.outputs.has_changes == 'true' | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| commit-message: "chore: update mockup screenshots" | |
| signoff: false | |
| branch: auto/update-screenshots | |
| delete-branch: true | |
| title: "chore: update mockup screenshots" | |
| body: | | |
| This PR was automatically generated by the update-screenshots workflow. | |
| Screenshots have been regenerated from the UX design mockups. | |
| labels: | | |
| automated | |
| documentation | |
| milestone: 1 | |
| draft: false | |
| generate-skipped: | |
| needs: changes | |
| if: needs.changes.outputs.mockups != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - run: echo "No mockup changes detected, skipping screenshot generation" |