sync theme submodules #550
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: sync theme submodules | |
on: | |
push: | |
branches: gh-pages | |
schedule: | |
- cron: "00 14 * * *" | |
workflow_dispatch: | |
jobs: | |
sync_theme_submodules: | |
if: github.repository_owner == 'ioos' # only run if ioos owns repo | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- 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 | |
keepalive-job: | |
name: Keepalive Workflow | |
runs-on: ubuntu-latest | |
if: github.event_name == 'schedule' | |
permissions: | |
actions: write | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- uses: gautamkrishnar/keepalive-workflow@995aec69bb3f2b45b20f4e107907992c8715086d # 2.0.8 |