Skip to content

Build Frontend Gallery Periodically #340

Build Frontend Gallery Periodically

Build Frontend Gallery Periodically #340

Workflow file for this run

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 "garybot2@graylog.com"
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