forked from clue/framework-x-website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub workflow to show diff between HTML pages on push/PRs
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: HTML diff | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
diff: | ||
name: HTML diff | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- run: git config --global url."https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "[email protected]/" | ||
# 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/ | ||
|
||
# clean build files to remove any leftovers before building new version | ||
- run: make clean | ||
|
||
# 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: | | ||
git diff --no-index --stat --color=always old/ new/ && echo No changed detected || true | ||
diff -r -u --color=always old/ new/ || true |
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