forked from devonfw/devonfw.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (46 loc) · 1.43 KB
/
update-submodules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Update Submodules
env:
BUILD_USER: ${{ secrets.BUILD_USER }}
BUILD_USER_EMAIL: ${{ secrets.BUILD_USER_EMAIL }}
on:
push:
branches: [ develop ]
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: develop
- 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 develop
echo "::set-output name=updated::true"
fi
- name: Dispatch Website Build
uses: guilouro/multiple-repositories-dispatch@v1.0.0
if: steps.update-submodules.outputs.updated == 'true'
with:
repo_token: ${{ secrets.GHA_TOKEN }}
event_type: dispatch-build-website
repositories: |
devonfw/devonfw.github.io