-
Notifications
You must be signed in to change notification settings - Fork 5
48 lines (45 loc) · 1.45 KB
/
build.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
48
name: Build Frontend Gallery Periodically
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: frontend-documentation
ref: gh-pages
- uses: actions/checkout@v4
with:
path: graylog2-server
repository: Graylog2/graylog2-server
- name: Prepare Github Pages Branch
working-directory: frontend-documentation
run: |
rm -r ./*
- name: Build Frontend Gallery
id: build
working-directory: graylog2-server/graylog2-web-interface
run: |
yarn install
cd docs
yarn install
yarn run docs:build
cp -r styleguide/* $GITHUB_WORKSPACE/frontend-documentation
SERVER_SHA=`git rev-parse HEAD`
echo "{serverSha}=${SERVER_SHA}" >> $GITHUB_OUTPUT
- name: Commit Results
working-directory: frontend-documentation
run: |
NUMBER_CHANGES=$(git status -s | wc -l)
if [[ $NUMBER_CHANGES -gt 0 ]]; then
git config --global user.email "[email protected]"
git config --global user.name "Gary Bot"
git add -A
git commit -m "Update website to ${{ steps.build.outputs.serverSha }}"
git push origin gh-pages
else
echo "No changes made, skipping commit"
fi