Skip to content

dispatch-update-website #1544

dispatch-update-website

dispatch-update-website #1544

name: Update Submodules
env:
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
on:
push:
branches: [ main ]
repository_dispatch:
types: [dispatch-update-website]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: setup git user
run: |
git config --global user.email ${BUILD_USER_EMAIL}
git config --global user.name ${BUILD_USER}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
ref: main
- name: update latest changes of devonfw-guide
id: update-submodules
run: |
git submodule update --remote
git add -u
# just commit if there is anything to committo prevent errors
if $(git diff --cached --exit-code)
then
echo "Nothing to commit!"
echo "::set-output name=updated::false"
else
git commit -m "[DocUpdate]"
git push origin main
echo "::set-output name=updated::true"
fi
- name: Dispatch Website Build
uses: guilouro/[email protected]
if: steps.update-submodules.outputs.updated == 'true'
with:
repo_token: ${{ secrets.GHA_TOKEN }}
event_type: dispatch-build-website
repositories: |
devonfw/devonfw.github.io