From 52955f395590c32034c000c05d48a6ec6a2d3dba Mon Sep 17 00:00:00 2001 From: MattGrossi-NOAA <122909244+MattGrossi-NOAA@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:18:22 -0500 Subject: [PATCH] Link to documentation-theme-jekyll with submodules and update daily --- .github/workflows/sync_theme.yml | 42 ++++++++++++++++++++++++++++++++ .gitmodules | 7 ++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/sync_theme.yml create mode 100644 .gitmodules diff --git a/.github/workflows/sync_theme.yml b/.github/workflows/sync_theme.yml new file mode 100644 index 0000000..97ef932 --- /dev/null +++ b/.github/workflows/sync_theme.yml @@ -0,0 +1,42 @@ +name: sync theme submodules + +on: + push: + branches: gh-pages + + schedule: + - cron: "00 14 * * *" + + workflow_dispatch: + + +jobs: + sync_theme_submodules: + if: github.repository_owner == 'MattGrossi-NOAA' # only run if I own repo (change if transferred to organization) + runs-on: ubuntu-20.04 + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: submodule checkout + run: | + git submodule update --init + - name: check submodule status + run: | + git submodule status + + - name: Update theme from submodules + run: | + git submodule update --remote --merge + + - name: check submodule status 2 + run: | + git submodule status + - name: Commit and push if it changed + run: | + git config user.name "Automated" + git config user.email "actions@users.noreply.github.com" + git add -A + timestamp=$(date -u) + git commit -m "Update theme on: ${timestamp}" || exit 0 + git push diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..80f83cf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,7 @@ +[submodule "documentation-theme-jekyll"] + path = theme + url = https://github.com/MattGrossi-NOAA/documentation-theme-jekyll +[submodule "_data/navbars_theme"] + path = _data/navbars + url = https://github.com/MattGrossi-NOAA/documentation-theme-jekyll + branch = navbars