Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
wkornewald committed Nov 11, 2023
1 parent 7415618 commit d59c8d5
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,41 @@ jobs:
if diff -q -r --no-dereference test latest; then
echo "CHECKEQUALS=true" >> "$GITHUB_OUTPUT"
fi
- name: Changed
if: steps.checkchanged.outputs.CHECKEQUALS == 'true'
run: echo changed
- name: Changed
if: steps.checkchanged.outputs.CHECKEQUALS != 'true'
run: echo unchanged
- name: Check if changed
id: checkchangedb
run: |
rm -rf tmp
mkdir tmp
cd tmp
docker pull --platform linux/amd64 ghcr.io/${{ github.repository }}:latest || exit 0
img=$(docker create --platform linux/amd64 ghcr.io/${{ github.repository }}:latest)
docker export $img -o latest.tar
docker rm $img
img=$(docker create --platform linux/amd64 ghcr.io/${{ github.repository }}:test)
docker export $img -o test.tar
docker rm $img
mkdir test
mkdir latest
tar xf test.tar -C test
tar xf latest.tar -C latest
if diff -q -r --no-dereference test latest; then
echo "CHECKEQUALS=true" >> "$GITHUB_OUTPUT"
fi
- name: Changed
if: steps.checkchangedb.outputs.CHECKEQUALS == 'true'
run: echo changed
- name: Changed
if: steps.checkchangedb.outputs.CHECKEQUALS != 'true'
run: echo unchanged
- name: Build and push
uses: docker/build-push-action@v5
if: github.event_name != 'pull_request' && steps.checkchanged.outputs.CHECKEQUALS == 'true'
Expand Down

0 comments on commit d59c8d5

Please sign in to comment.