Skip to content

Commit

Permalink
Add GitHub workflow to show diff between HTML pages on push/PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Mar 7, 2024
1 parent b006e32 commit 9791e3f
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: HTML diff

on:
push:
pull_request:

jobs:
diff:
name: HTML diff
runs-on: ubuntu-22.04
steps:
# check out base ref and build site into old/
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }}
- run: git clone https://github.com/clue/framework-x.git source/
- run: make && mv build/ old/

# check out head ref and build site into new/
- uses: actions/checkout@v4
with:
clean: false # Prevent removing files in old/
- run: make && mv build/ new/

# Diff between old/ and new/
- name: Diff between old/ and new/
run: |
rm old/sitemap.xml.gz new/sitemap.xml.gz; git diff --no-index --stat --color=always old/ new/ && echo No changed detected || true
diff -r -u --color=always old/ new/ || true

0 comments on commit 9791e3f

Please sign in to comment.