Only commit website changes if there are some
This commit is contained in:
4
.github/workflows/deploy.yml
vendored
4
.github/workflows/deploy.yml
vendored
@@ -32,11 +32,13 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
cp -r build/site/* openlayers.github.io/dist/
|
cp -r build/site/* openlayers.github.io/dist/
|
||||||
cd openlayers.github.io
|
cd openlayers.github.io
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
||||||
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Website updates"
|
git commit -m "Website updates"
|
||||||
git push origin main
|
git push origin main
|
||||||
|
fi
|
||||||
deploy-tag:
|
deploy-tag:
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -60,8 +62,10 @@ jobs:
|
|||||||
- run: |
|
- run: |
|
||||||
cp -r build/site/* openlayers.github.io/dist/
|
cp -r build/site/* openlayers.github.io/dist/
|
||||||
cd openlayers.github.io
|
cd openlayers.github.io
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
|
||||||
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Website updates"
|
git commit -m "Website updates"
|
||||||
git push origin main
|
git push origin main
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user