Skip to content

Update nightly_update.yaml #3

Update nightly_update.yaml

Update nightly_update.yaml #3

Workflow file for this run

name: Update and Push MOM6 and Ocean BGC Submodule
on:
# schedule:
# - cron: '0 * * * *' # Run every hour
push:
branches: [ "feature/update-ci" ]
jobs:
nightly_update:
runs-on: ubuntu-latest
steps:
- name: Set Git user name and email
run: |
git config --global user.email ${{ secrets.GHA_EMAIL }}
git config --global user.name ${{ secrets.GHA_ID }}
- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
submodules: 'recursive'
- name: Update Ocean BGC Submodule
run: |
git submodule update --remote --merge src/ocean_BGC
git add src/ocean_BGC
git commit -m "Update ocean_BGC submodule nightly"
- name: Trigger CI tests for Ocean BGC Submodule
run: |
curl \
-X POST \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/NOAA-GFDL/CEFI-regional-MOM6/actions/workflows/mom6_cobalt_1D.yaml/dispatches \
-d '{"ref":"main"}'
- name: Wait for CI tests to complete
run: |
# Use the GitHub API to check the status of the workflow runs
# Wait until all jobs in the workflow run are completed
# Check if all jobs are successful